User Tools

Site Tools


ubnt:dns_forwarding

DNS Forwarding

Access the command line interface (CLI) of the router. You can do this using the CLI button in the GUI or by using a program such as PuTTY.

Set the System Name Server to 127.0.0.1, and then configure dnsmasq (the DNS forwarder) with the nameservers you want to use. (Replace references to eth4 with your WAN port)

configure
delete system name-server
set system name-server 127.0.0.1

Tell the dhcp-client not to add the ISP DNS servers to /etc/resolv.conf.

set interfaces ethernet eth4 dhcp-options name-server no-update

Then you can add your nameservers to dnsmasq and set the cache size.

set service dns forwarding name-server 1.1.1.1
set service dns forwarding name-server 1.0.0.1
set service dns forwarding name-server 8.8.8.8
set service dns forwarding name-server 8.8.4.4

set service dns forwarding cache-size 200

Then, commit your changes, save the new config, release and renew your WAN IP to remove the ISP servers from /etc/resolv.conf

commit
save
exit
release dhcp interface eth4
renew dhcp interface eth4

Now, when you type show dns forwarding nameservers, it should look like this:

-----------------------------------------------
   Nameservers configured for DNS forwarding
-----------------------------------------------
1.1.1.1 available via 'statically configured'
1.0.0.1 available via 'statically configured'
8.8.8.8 available via 'statically configured'
8.8.4.4 available via 'statically configured'

-----------------------------------------------
 Nameservers NOT configured for DNS forwarding
-----------------------------------------------
127.0.0.1 available via 'system'
ubnt/dns_forwarding.txt · Last modified: 2018/12/09 06:39 by derek