voipmeister.com voip stuff matters and more

DNS forwarding on the Ubiquiti EdgeRouter X

Today I wanted to properly set up DNS forwarding on my Ubquiti EdgeRouter X. More specifically, I wanted to use the OpenDNS FamilyShield DNS servers:

This means that you if you want to use other nameservers, you should substitute those IP addresses for the ones you prefer.


  • Ubiquiti EdgeRouter X (EdgeOS 1.9.0)
  • eth0 is the WAN port
  • WAN IP is obtained via DHCP
  • LAN DHCP settings are already in place (DNS points to the LAN gateway IP and DNS listening on the interface is configured)


First, we enter configuration mode and delete existing nameservers:

delete system name-server

Then, we set the system nameservers (note that these will be used by the system, not for forwarding):

set system name-server
set system name-server

If the WAN IP adres is obtained via DHCP, you need to tell the router not to update the nameserver configuration:

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

Finally, here”s the most important part:

set service dns forwarding name-server
set service dns forwarding name-server

The round-up is as follows:

release dhcp interface eth0
renew dhcp interface eth0

The last 2 statements make sure that the provider IP settings are being refreshed. On my device, it took some time for the settings to take effect.


There are multiple ways to verify the setup.

1. Check the configuration

You can check the setup on the router with this statement:

show dns forwarding nameservers

The output should be something like:

   Nameservers configured for DNS forwarding
----------------------------------------------- available via ''statically configured'' available via ''statically configured''
2. Surf for some inappropriate content

When surfing for some inappropriate content, the result should be:

Mission accomplished :)