Correct Way to Set DNS Server

Okay I've finally sorted it! I've made some instructions just in case anyone comes across this thread :slight_smile:

WAN

  1. Go to 'Network > Interfaces > WAN'
  2. Under 'Common Configuration' select the 'Advanced Settings' tab and uncheck ' Use DNS servers advertised by peer'
  3. In the box below enter the OpenDNS Servers '208.67.220.22'0 and '208.67.222.222'
  4. Click the 'Save' button
config interface 'wan'
        option proto 'pppoe'
        option username 'user@domain.com'
        option password 'password'
        option ipv6 'auto'
        option ifname 'eth1'
        option mtu '1492'
        option peerdns '0'
        option dns '208.67.222.222 208.67.220.220'

LAN

  1. Go to 'Network > Interfaces > LAN'
  2. Under 'DHCP Server' set 'DHCP-Options' to '6,208.67.222.222,208.67.220.220'
  3. Click the 'Save' button
config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '1h'
        list dhcp_option '6,208.67.222.222,208.67.220.220'

DHCP & DNS

  1. Go to 'Network > DHCP and DNS'
  2. Under 'Server Settings' select the 'Resolv and Hosts Files' tab ensure the 'Ignore resolve file' is unchecked
  3. Click the 'Save' button

Firewall

  1. Go to 'Network > Firewall'
  2. Under the 'Port Forwards' tab enter 'Force DNS' under 'New port forward' section
  3. Set the 'Protocol to TCP+UDP
  4. Set 'External zone' to 'WAN' **
  5. Set 'External port' to '53'
  6. Set 'Internal zone' to 'lan' **
  7. Set 'Internal port' to '53'
  8. Click the 'Add' button
  9. Once it's added to the list open it back up by clicking the 'Edit' button
  10. Change the 'Source zone' from 'wan' to 'lan'
  11. Click the 'Save & Apply' button
    ** If you're unable to set the exact zones simply select anything as you can change it in step 9
config redirect
        option enabled '1'
        option target 'DNAT'
        option dest 'lan'
        option proto 'tcp udp'
        option src_dport '53'
        option dest_port '53'
        option name 'Force DNS'
        option src 'lan'



Your firewall rule you should like the following

Finally reboot your router by heading to 'System > Reboot'

11 Likes