How to: disable wvdial Auto DNS -- use static DNS settings

Sometimes you wanted to get rid of your crappy ISP DNS servers for good.

I'm using wvdial to dial up, here's what I do.

Steps:

  • Disable usepeerdns. Edit "/etc/ppp/peers/wvdial" file. Commented the usepeerdns line. Here's what is should look:
    #usepeerdns
    

  • Disable Auto DNS in wvdial. Edit "/etc/wvdial.conf" file. Set Auto DNS Off.
    Auto DNS = Off
    

  • Add your own DNS servers to "/etc/resolv.conf" file. Eg.:
    nameserver 8.8.8.8
    nameserver 8.8.4.4
    

    Those are Google Public DNS service, a very good ones, and best of all, its free!

    More of free public resolving nameservers here.

  • Edit "/etc/dhcp3/dhclient.conf". Find:
    prepend domain-name-servers 127.0.0.1;
    

    Add your nameserver to the line, ie:
    ...
    prepend domain-name-servers 8.8.8.8,8.8.4.4;
    ...
    

  • Done!

Good luck!

Comments

Thanks it works in Debian squeeze !!!

I had already tried the parameter Auto DNS. It did not work and as in the man wvdialconf it is written that this option was added by Suse :
Auto DNS
Try to get the Domain Nameserver (DNS) from the provider. This option is "on" by default. (Option added by SuSE.)
I stopped to try for a while ...
You gave me hopes and I tried again but this time I looked more carefully my logs :
Aug 28 08:59:54 localhost pppd[28725]: In file /etc/ppp/peers/wvdial: unrecognized option 'Auto'
and I am still with my old DNS and I have a lot of reasons to be very sad

Oups
Auto DNS has to be in wvdial.conf, you said and you are right, not in /etc/ppp/peers/wdial.
I try again

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

If you enjoyed this post, make sure you subscribe to our RSS Feed! Or if you prefer, you can Follow us on Twitter instead.

This is my notes page -- a scratch pad. Sometimes I do not write them correctly. I wrote here so I can access my notes from everywhere. If you want to use them, use with caution. Please check and re-check the syntax. You've been warned!