LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-24-2013, 08:10 PM   #1
shams
Member
 
Registered: Jan 2004
Posts: 479

Rep: Reputation: 30
Question /etc/resolv.conf and dnsmasq resolution problem?


Debian wheezy is connected with eth0 to the ADSL modem router, network manager is configured for dhcp and gets it's private ip from the router, the rourer private ip is 182.168.1.1 that is also the default gateway, the network manager overrite the /etc/resolv.conf in every boot as:
Quote:
domain Home
search Home
namserver 182.168.1.1
namserver 182.168.1.1
with above resolv.conf dnsmasq cannot resolve the local host names for my web and mail server, for the dnsmasq to work properly the resolv.conf should have these 3 lines in order:
Quote:
namserver 127.0.0.1
namserver 182.168.1.1
search Home
To solve the problem i installed the packages resolvconf and add the above 3 lines to the /etc/resolvconf/resolv.conf.d/original but the resolvconf overrite the resolv.conf to only these two lines in every boot:
Quote:
namserver 127.0.0.1
search Home
and the new problem is now cannot open the external web.
Can any one help how to configure the resolvconf that write the 3 lines to /etc/resolv.conf on every boot?

Last edited by shams; 09-24-2013 at 08:14 PM.
 
Old 09-25-2013, 02:17 PM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
There is always the possibility that I haven't understood fully, but...

Quote:
Originally Posted by shams View Post
Debian wheezy...
This is the box that you are working with...it is running Debian Wheezy (which only really matters because we can call it 'the wheezy box' for convenience).

Quote:
Originally Posted by shams View Post
Debian wheezy is connected with eth0 to the ADSL modem router, network manager is configured for dhcp and gets it's private ip from the router,
So the router is being the DHCP server (and, therefore, dnsmasq shouldn't be). NM is the client on the wheezy box, and that's all working.

Quote:
Originally Posted by shams View Post
the network manager overrite the /etc/resolv.conf in every boot as
That is normal behaviour, but it should get put back to the previous state when you shut down.

Quote:
...with above resolv.conf dnsmasq cannot resolve the local host names for my web and mail server, for the dnsmasq to work properly the resolv.conf should have these 3 lines in order...
Well, that's a possibility, but maybe not the best one. A brief re-acquaintance with the man page suggests that using the 'additional hosts file' option gets you away from the problem of having stuff in resolv.conf overwritten by whatever feels that it would like to. I think that you want -H rather -h, but you could probably make -h work, too.

Quote:
Originally Posted by shams View Post
To solve the problem i installed the packages resolvconf and add the above 3 lines to the /etc/resolvconf/resolv.conf.d/original but the resolvconf overrite the resolv.conf to only these two lines in every boot:

and the new problem is now cannot open the external web.
Can any one help how to configure the resolvconf that write the 3 lines to /etc/resolv.conf on every boot?
I don't see any reason that the original method plus the additional hosts file shouldn't work without any further messing about, although there are almost certainly other ways that you could get it working.

You might also choose to use some combination of -R (don't use resolv.conf at all) and -r (read the IPs of the upstream servers from the specified file), and that way other processes can trample all over resolv.conf and you won't bothered. If you do do this, however, I would recommend that you document what you are doing wherever someone subsequently messing with this might look; it could easily confuse them if resolve.conf isn't doing what is expected, and doubly embarrassing if the person turns out to be you.

You could alternatively use the -s switch, but reading the explanation makes my head hurt (slightly), but I think it would be an equally good method.

(And, from what I said earlier, it seems that you cannot want -F, but, from what I remember, provided that you don't uncomment any of the dhcp stuff, that issue need not come up, because the defaults do not enable the dhcp side of the server.)
 
Old 09-26-2013, 11:13 PM   #3
shams
Member
 
Registered: Jan 2004
Posts: 479

Original Poster
Rep: Reputation: 30
Question

Thanks for reply, the dnsmasq is already configured for what you suggests:
Quote:
resolv-file=/etc/resolv.conf
resolv-file=/etc/resolv.dnsmasq
addn-hosts=/etc/hosts.dnsmasq
dhcp-range=192.168.1.2,192.168.1.150,12h
and i add the nameservers to resolv.dnsmasq and the local hosts names to the hosts.dnsmasq but with all this is the above problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
etc/resolv.conf Problem watcher69b Linux - Newbie 2 07-17-2008 01:08 PM
DNSMASQ has problems with 'resolv.conf' Ashrack Linux - Networking 5 07-03-2006 01:03 PM
DNS Hosts.conf or resolv.conf problem mac_casey SUSE / openSUSE 0 03-26-2006 09:21 AM
problem with resolv.conf roddyguk Linux - Software 8 01-18-2006 12:57 PM
/etc/resolv.conf and dnsmasq on a gateway win32sux Linux - Networking 12 02-27-2005 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration