OpenWrt Forum Archive

Topic: DNS on Backfire

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

I have a WRT54GL on which I previously ran White Russian without problem.

I have flashed the router with Backfire (10.03) and it works well with one exception.

When using White Russian, my /etc/resolv.conf on the local pc pointed to 127.0.0.1 for the nameserver and the router forwarded dns information to this.

Now that I have installed Backfire this does not appear to happen.  I modified the DNS-Server entry under the Network/General tab under LuCI to point to the Opendns servers but the dns requests do not appear to be being forwarded as they were with White Russion.

What do I need to do to make this work?

1) point the local PCs DNS to the routers IP address not 127.0.0.1 (e. g. 192.168.1.1) or simply use DHCP client on the local PCs

2) In the WAN section of /etc/config/network put in option 'dns' '208.67.222.222 208.67.220.220'. This will override the name servers you got from your ISP with the ones by OpenDNS. Commands for UCI CLI:

uci set network.wan.dns='208.67.222.222 208.67.220.220'
uci commit network
ifdown wan
ifup wan

The dns option is documented at: http://wiki.openwrt.org/doc/uci/network

(Last edited by Dogge on 17 Jul 2010, 08:19)

Your client PC resolv.conf should only have the router's IP. If it points to 127.0.0.1 your client PC will try to resolve locally. Maybe you have already dnsmasq running on the client. If so, stop it.

Comment out all prepend, append and supersede options of your local dhclient conf file (/etc/dhclp3/dhclient3.conf on debian). Request a new lease:
# dhclient or dhclient3

Check the content of the /etc/resolv.conf on the client. And check how your PC resolves by doing:
# dig openwrt.org

Output should be something like:
;; ANSWER SECTION:
openwrt.org.        604800    IN    A    78.24.191.177

;; Query time: 45 msec
;; SERVER: 192.168.0.200#53(192.168.0.200)
;; WHEN: Sat Jul 17 08:42:46 2010
;; MSG SIZE  rcvd: 45

The SERVER value in the ANSWER SECTION should show the router IP through which the client tries to resolve the domain name.

If you want to add different DNS server names you can also add these lines in the /etc/dnsmasq.conf
dhcp-option=6,0.0.0.0,xxx.xxx.xxx.xxx,yyy.yyy.yyy.yyy
strict-order

This fixed the problem.  Thanks.

Post #2 or post #3?

The discussion might have continued from here.