#!/bin/bash # This script came from ubnt.com forum user "bradd" in the following post # http://community.ubnt.com/t5/EdgeMAX/Automatic-DNS-resolution-of-DHCP-client-names/td-p/651311 # It has been modified by Ubiquiti to update the /etc/host file # instead of adding to the CLI. # Thanks to forum user "itsmarcos" for bug fix & improvements # Thanks to forum user "ruudboon" for multiple domain fix # Thanks to forum user "chibby85" for expire patch and static-mapping if [ $# -lt 1 ]; then echo Invalid args logger -s -t on-dhcp-event "Invalid args \"$@\"" exit 1 fi action=$1 hostsd_client="/usr/bin/vyos-hostsd-client" get_subnet_domain_name () { python3 <