OpenWrt Forum Archive

Topic: wrt54g3g and Static DNS

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

I have a WRT54G3G with kamikaze 7.09.
I have this problem: when I connect at my ISP with HSDPA card I receive two bad DNS. How can I do for add a two dns in the resolv.conf.auto?  who write into resolv.conf.auto?
thanks

I had this same problem.


I ended up just using OpenDNS permanently.

Create a file in /etc called resolv.conf.opendns containing

nameserver 208.67.222.222
nameserver 208.67.220.220

Then tell dnsmasq to use it. In /etc/config/dhcp (the last line):

config dnsmasq
        option domainneeded     1
        option boguspriv        1
        option filterwin2k      '0'  #enable for dial on demand
        option localise_queries 1
        option local    '/lan/'
        option domain   'lan'
        option expandhosts      1
        option nonegcache       0
        option authoritative    1
        option readethers       1
        option leasefile        '/tmp/dhcp.leases'
        option resolvfile       '/etc/resolv.conf.opendns'

hi, i think it does the same as you want, i tried it yesterday it works for me till now, but maybe it wont work after reconnect--> i hope not
make a file in /etc/ppp/ip-up.d/ called "nameserver.sh" with the content (replace the dns from my provider with yours)

#!/bin/sh

rm /tmp/resolv.conf.auto
echo "nameserver 139.7.30.125">>/tmp/resolv.conf.auto
echo "nameserver 139.7.30.126">>/tmp/resolv.conf.auto
chmod 777 /tmp/resolv.conf.auto

then make this file executable with the command in the console:

chmod 777 /etc/ppp/ip-up.d/nameserver.sh

finally add in /etc/config/network in the       " config 'interface' 'wan' "  sektion the line:

option 'peerdns' '0'

then do a reconnect
that's all, hope i could help.

sorry i just reread your post and this way works only for kamikaze 8.09 because the "option peerdns" dont exist in 7.09 as i read in internet.
nevertheless it also worked for me in kamikaze 7.09, the only thing i did not do was add "option peerdns" !
in kamikaze 7.09 i only made the file nameserver.sh .  it also worked well, try it out.

The discussion might have continued from here.