OpenWrt Forum Archive

Topic: Custom DNS server

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,
I have just installed OpenWRT on my Linksys WRT54GL and it works great.
One last step of configuration is setting up a custom DNS server. I am using "unblock-us" which is a service that allows me to consume services outside the USA that normally would have been blocked to me.
This requires changing the DNS server to theirs.
In luCI, I see two possible options:
1. under the LAN interface, there's an option to "Use custom DNS servers".
2. under "DHCP and DNS" there's "DNS forwardings".
Which one should I use? (potion 2 feels better to me).

Thanks.

This is what works for me, but I can do it only via command line, I don't use luci:

1. vi /etc/config/resolv.user
# press a as for add and paste there your dns servers (these are opennic):
nameserver 78.138.98.82
nameserver 192.121.121.14
# :wq

2. vi /etc/config/dhcp
# press a and edit the resolvfile option to use the custom file you have just created:
        option resolvfile '/etc/config/resolv.user'
# :wq

That should be it.

(Last edited by nozombian on 20 Apr 2014, 16:53)

Untick "use peer dns" in the wan interface and enter your custom dns servers

Does this work with pppoe connections as well? I would hate to try this just to find out that I messed up my router.

Ended up configuring this os the WAN interface as per this answer:https://forum.openwrt.org/viewtopic.php?id=39954
Seems to work fine.

That seems to be the opinion. What I can't find though is the purpose of "Use custom DNS servers" in the LAN interface. Particularly considering the one in WAN is essentially hidden, the one in LAN is probably getting considerable more use.

nozombian wrote:

This is what works for me, but I can do it only via command line, I don't use luci:

1. vi /etc/config/resolv.user
# press a as for add and paste there your dns servers (these are opennic):
nameserver 78.138.98.82
nameserver 192.121.121.14
# :wq

2. vi /etc/config/dhcp
# press a and edit the resolvfile option to use the custom file you have just created:
        option resolvfile '/etc/config/resolv.user'
# :wq

That should be it.

Then do it the right way:

uci set network.wan.peerdns=0
uci set network.wan.dns="8.8.8.8 8.8.4.4"
uci commit network
ifup wan
/etc/init.d/dnsmasq restart

Done :-)

(Last edited by written_direcon on 6 Oct 2014, 18:46)

The discussion might have continued from here.