OpenWrt Forum Archive

Topic: dnsmask questions

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

Hello to everybody,

I would like to use opennic on my router; nothing more simple, it seems. First 1 fetched a long list (6-7) opennic Tier2 servers.
Then I paste them into /etc/config/network:

config interface 'wan'
    option ifname 'eth0.2'
    option proto 'static'
    option ipaddr '192.168.0.36'
        option netmask '255.255.255.0'
        option gateway '192.168.0.1'
        option dns     'aa.bb.cc.dd'
        option dns     'ee.ff.gg.hh'
        option dns     'ii.kk.ll.mm.nn'

      etc.

Then I restart dnsmask. However: the /tmp/resolf.conf.auto  contains only the very last entry. I also tried one huge list:

option dns     'aa.bb.cc.dd   ee.ff.gg.hh'

same problem. Next, /etc/resolv/conf   points to self (127.0.0.1), so I never see which dns server is really used. That is annoying.

Could somebody help please?

thx, Eric

Bonus question: I can increase dhcp cachesize, say to 500 entries or so to limit traffic. Is there a way to control how long a dns entry is stored?
double bonus question: is there a way to cross-check the dns-cache by a different second  dns server?

It must be "list" instead of "option" for those UCI entries that may be specified multiple times.

list dns 'aa.bb.cc.dd'
list dns 'ee.ff.gg.hh'
list dns 'ii.kk.ll.mm.nn'

Remember option peerdns 0 if you exclusively want to use the DNS servers that you configure manually.
http://wiki.openwrt.org/doc/uci/network#protocol.dhcp

"ifup wan" is enough to make the changes take effect.

http://myresolver.info/ is nice for checking which DNS servers is used as it "overrides" any cache.

Alternatively you configure dnsmasq directly with the DNS servers in /etc/config/dhcp (in that case pay attention to option noresolv). I believe it to be more "proper" in your scenario.

/etc/resolv/conf -> /tmp/resolv/conf is not used because dnsmasq is configured to use /tmp/resolv.conf.auto

glenten is right, you have to use list, or seperate servers by spaces like option dns '11.22.33.44 aa.bb.cc.dd'

This is what I do and what works also for wan ip assigned by dhcp:

root@wr1043nd:~# vi /etc/config/resolv.user
nameserver 78.138.98.82
nameserver 192.121.121.14

root@wr1043nd:~# vi /etc/config/dhcp
        option resolvfile '/etc/config/resolv.user'

The discussion might have continued from here.