Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to setup dnsmasq to accelerate DNS resolving , but since i use a PPPoE connection , there're both dns server provided by ISP , and the 127.0.0.1.

So how can i place the local dns server as the first line in /etc/resolv.conf automatically ? And please don't let me use a static dns server configuration ..

Thanks !

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You don't need to list any nameserver other than 127.0.0.1 in /etc/resolv.conf. What you need to inform dnsmasq of the upstream DNS server, and it will relay and cache requests to the ISP's server.

If your ISP's DNS providers don't change (they rarely do), you can declare them in the Dnsmasq configuration file (/etc/dnsmasq.conf), with lines like server=203.0.113.1. If your ppp or dhcp daemon drops the addresses of your ISP's providers in a file, say /etc/ppp/resolv.conf, then reference that file in dnsmasq.conf: resolv-file=/etc/ppp/resolv.conf.

You'll find instructions for most common setups in the Dnsmasq setup documentation, and the complete list of options in the example configuration file.

If you're running Debian, Ubuntu or some other distribution with a resolvconf package, install it. Resolvconf automatically manages adding and removing entries from the DNS configuration when you connect or disconnect to a network.

share|improve this answer
    
Very impressive , I've been misunderstanding for the concept for a while , right , only localhost should appear in /etc/resolv.conf. Thanks ! –  warl0ck Jan 4 '12 at 0:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.