Notes on Ubiquiti networking equipment (UniFi, EdgeRouter etc.)
This enables local DNS hostname resolution. See: https://help.ubnt.com/hc/en-us/articles/115002673188-EdgeRouter-Using-dnsmasq-for-DHCP-Server
Enable dnsmsq:
configure
set service dhcp-server use-dnsmasq enable
commit
save
exit
Set system name-server to loop back to the router itself, which will forward requests to the DNS servers set in the DNS forwarding settings by entering the following:
set system name-server 127.0.0.1
Set global name-servers to resolve all external resolutions.
set service dns forwarding name-server 1.1.1.1
Set DNS forwarding listen-on address for all LAN interfaces including VLANs (your specific interfaces may be different, I have three ports setup as a switch and no VLANs).
set service dns forwarding listen-on eth0
set service dns forwarding listen-on switch0
Increase DNS forwarding cache-size (optional).
set service dns forwarding cache-size 4000
Set system domain-name (use your own name here).
set system domain-name mhurd.local
Set domain-name for dhcp-servers, use your shared-network names and subnets (you can find thes ein the config tree under the dhcp section).
set service dhcp-server shared-network-name switch subnet 192.168.2.0/24 domain-name mhurd.local
set service dhcp-server shared-network-name wired-eth0 subnet 192.168.1.0/24 domain-name mhurd.local
Set static host mapping for each local device, you may already have done this if you have set up static mappings, the name you assign will be the hostname.
set service dhcp-server shared-network-name wired-eth0 subnet 192.168.1.0/24 static-mapping arbus ip-address 192.168.1.177
set service dhcp-server shared-network-name wired-eth0 subnet 192.168.1.0/24 static-mapping arbus mac-address 70:85:c2:2b:45:55
Then commit and save.
commit
save
exit
You can set up CNAMEs for your servers in the port forwarding section like so (where jenkins.home is the CNAME):
dns {
forwarding {
cache-size 4000
listen-on eth0
listen-on switch0
options cname=jenkins.home,soth.home
}
}