Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   taming resolv.conf (http://www.linux-archive.org/debian-user/70837-taming-resolv-conf.html)

"Digby Tarvin" 04-16-2008 04:16 PM

taming resolv.conf
 
Another little niggle from my recent install which doesn't seem to be
as straight forward as it should be... I hope someone can point me
at what I am doing wrong...

Immediately following my Etch 40r3 netinstall my /etc/network/interfaces
had a pretty standard looking
precision:/etc/network# grep -v '#' /etc/network/interfaces.orig
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
My /etc/resolv.conf file looked ok, except the DHCP server in my
router provides nameserver IP only, no search list.

After a bit of searching it looked like the resolvconf package would
be an simple solution, so I installed it and updated my loopback
device entry to insert the search list as follows:
auto lo
iface lo inet loopback
dns-search cthulhu.dircon.co.uk

That all worked fine, except that ever since resolvconf was
installed the nameserver address returned by the DHCP server
seems to be being installed. My new /etc/resolv.conf is
coming up as:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search cthulhu.dircon.co.uk


If I revert to the original interfaces file, /etc/resolv.conf is
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1

And if I then apt-get remove resolvconf and reboot then the original
resolv.conf with correct dhcp supplied nameserver (but no search) returns:
# generated by NetworkManager, do not edit!



nameserver 203.27.41.5


Any suggestions? I do like the idea of having any static nameserver
information in the /etc/network/interfaces file with the rest of
the network config, so resolvconf would be good if it worked as
expected....

Regards,
DigbyT


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Andrei Popescu 04-16-2008 05:00 PM

taming resolv.conf
 
On Wed, Apr 16, 2008 at 04:16:13PM +0000, Digby Tarvin wrote:

> Any suggestions? I do like the idea of having any static nameserver
> information in the /etc/network/interfaces file with the rest of
> the network config, so resolvconf would be good if it worked as
> expected....

If I understood correctly what you want you need this is
/etc/network/interfaces:

dns-nameserver 123.234.123.234

More info in /usr/share/doc/resolvconf/README.gz section 3.4

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)

"Digby Tarvin" 04-16-2008 05:08 PM

taming resolv.conf
 
On Wed, Apr 16, 2008 at 08:00:12PM +0300, Andrei Popescu wrote:
> On Wed, Apr 16, 2008 at 04:16:13PM +0000, Digby Tarvin wrote:
>
> > Any suggestions? I do like the idea of having any static nameserver
> > information in the /etc/network/interfaces file with the rest of
> > the network config, so resolvconf would be good if it worked as
> > expected....
>
> If I understood correctly what you want you need this is
> /etc/network/interfaces:
>
> dns-nameserver 123.234.123.234
>
> More info in /usr/share/doc/resolvconf/README.gz section 3.4
>
> Regards,
> Andrei

Not quite. I only want the static information in the interfaces file.
I still want the nameserver address that is supplied by DHCP to be
used.

I do know how to hardwire a nameserver and IP address if I am not
using DHCP, but resolvconf is not really so necessary in that
situation.

Regards,
DigbyT


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Andrei Popescu 04-16-2008 05:37 PM

taming resolv.conf
 
On Wed, Apr 16, 2008 at 05:08:08PM +0000, Digby Tarvin wrote:
> On Wed, Apr 16, 2008 at 08:00:12PM +0300, Andrei Popescu wrote:
> > On Wed, Apr 16, 2008 at 04:16:13PM +0000, Digby Tarvin wrote:
> >
> > > Any suggestions? I do like the idea of having any static nameserver
> > > information in the /etc/network/interfaces file with the rest of
> > > the network config, so resolvconf would be good if it worked as
> > > expected....
> >
> > If I understood correctly what you want you need this is
> > /etc/network/interfaces:
> >
> > dns-nameserver 123.234.123.234
> >
> > More info in /usr/share/doc/resolvconf/README.gz section 3.4
> >
> > Regards,
> > Andrei
>
> Not quite. I only want the static information in the interfaces file.
> I still want the nameserver address that is supplied by DHCP to be
> used.
>
> I do know how to hardwire a nameserver and IP address if I am not
> using DHCP, but resolvconf is not really so necessary in that
> situation.

I don't think the static dns server in the interfaces file will override
the DHCP provided one, but I can't tell for sure. You will have to read
the resolvconf docs for this.

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)

Michael Shuler 04-16-2008 07:30 PM

taming resolv.conf
 
Digby Tarvin wrote:
> My /etc/resolv.conf file looked ok, except the DHCP server in my
> router provides nameserver IP only, no search list.
>
> Any suggestions? I do like the idea of having any static nameserver
> information in the /etc/network/interfaces file with the rest of
> the network config, so resolvconf would be good if it worked as
> expected....

I do this all in /etc/dhcp3/dhclient.conf - custom prepended domains for
search, as well as superseding some rather useless caching resolvers in
favor of another pair. Works regardless of whether I use the interfaces
file, resolvconf, NetworkManager, etc., which all use dhclient in the
end. Hope that helps!

--
Kind Regards,
Michael Shuler


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

"Digby Tarvin" 04-16-2008 10:08 PM

taming resolv.conf
 
Combining the responses to the previous to posters...

On Wed, Apr 16, 2008 at 08:37:30PM +0300, Andrei Popescu wrote:
> On Wed, Apr 16, 2008 at 05:08:08PM +0000, Digby Tarvin wrote:
> > Not quite. I only want the static information in the interfaces file.
> > I still want the nameserver address that is supplied by DHCP to be
> > used.
> >
> > I do know how to hardwire a nameserver and IP address if I am not
> > using DHCP, but resolvconf is not really so necessary in that
> > situation.
>
> I don't think the static dns server in the interfaces file will override
> the DHCP provided one, but I can't tell for sure. You will have to read
> the resolvconf docs for this.

I hope it didn't sound like I hadn't bothered to read any documentation ;)

My understanding is that one of the main functions of resolvconf is to
deal with multiple sources of DNS information (such as a mixture of HDCP
and static interfaces in one system) and to merge all the server
addresses and domains into a single resolv.conf - rather than have
the last interface that is brought up to over write the data from
the earlier ones.

Consequently, whilst in my case it is using a sledge hammer to crack a
nut, I seems to be that it should be able to do what I want. That is,
to merge the information obtained by dhcp with a static search domain.

AND...


On Wed, Apr 16, 2008 at 02:30:39PM -0500, Michael Shuler wrote:
> Digby Tarvin wrote:
> > My /etc/resolv.conf file looked ok, except the DHCP server in my
> > router provides nameserver IP only, no search list.
> >
> > Any suggestions? I do like the idea of having any static nameserver
> > information in the /etc/network/interfaces file with the rest of
> > the network config, so resolvconf would be good if it worked as
> > expected....
>
> I do this all in /etc/dhcp3/dhclient.conf - custom prepended domains for
> search, as well as superseding some rather useless caching resolvers in
> favor of another pair. Works regardless of whether I use the interfaces
> file, resolvconf, NetworkManager, etc., which all use dhclient in the
> end. Hope that helps!

Thanks. That might be a workaround. Although I don't think it is ideal
because:

1. I am setting up four systems, and only two are using dhcp. The others
are servers on the local lan, and hence will have static ip addresses.

2. I was hoping to hoping to make these systems fairly interchangeable and
potable, with all of the network configuraiton customizing localized to
the /etc/network/interfaces file..

So I would really like to get to the bottom of why resolvconf is not
honouring the dns server address obtained by dhcp if at all possible.

Regards,
DigbyT


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

04-16-2008 11:16 PM

taming resolv.conf
 
Digby Tarvin wrote:
> My new /etc/resolv.conf is coming up as:
> nameserver 127.0.0.1

This is correct if you have bind9 installed. Since this is
automatically detected then I assume that you do have bind9 installed
in order to see this result. If you remove bind9 then you would see
the DHCP nameserver addresses there.

In which case there is one manual step to installing resolvconf. You
would need to change:

include "/etc/bind/named.conf.options";

To this:

include "/var/run/bind/named.options";

The resolvconf package scripts know about bind9 and if it is installed
then they assume that you want to use it and automatically set up
/var/run/bind/named.options with the nameservers offered by DHCP.

Bob

"Digby Tarvin" 04-17-2008 04:34 PM

taming resolv.conf
 
On Wed, Apr 16, 2008 at 05:16:16PM -0600, Bob Proulx wrote:
> Digby Tarvin wrote:
> > My new /etc/resolv.conf is coming up as:
> > nameserver 127.0.0.1
>
> This is correct if you have bind9 installed. Since this is
> automatically detected then I assume that you do have bind9 installed
> in order to see this result. If you remove bind9 then you would see
> the DHCP nameserver addresses there.
>
> In which case there is one manual step to installing resolvconf. You
> would need to change:
>
> include "/etc/bind/named.conf.options";
>
> To this:
>
> include "/var/run/bind/named.options";
>
> The resolvconf package scripts know about bind9 and if it is installed
> then they assume that you want to use it and automatically set up
> /var/run/bind/named.options with the nameservers offered by DHCP.
>
> Bob

Aha! Yes, that was it. Thanks!

Just removing bind9 was enough to produce the expected behaviour.

Not sure I follow the bit about the manual step required. Which file
is it that is being edited? can't find anything in etc/resolvconf..

Or is that a step which would allow use of the DHCP values with bind9
still isntalled?

I suppose the latter would be useful to be able to do, so that all my
servers could be configured to run off a single nameserver, but be
able to take over as the nameserver with a simple change of config
if desired. (I am setting one up for a friend that wants to give
debian a try, but is not experienced in Linux admin, so fairly simple
but flexible network adaptability would be a big advantage)

Regards,
DigbyT


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

04-18-2008 06:03 PM

taming resolv.conf
 
Digby Tarvin wrote:
> On Wed, Apr 16, 2008 at 05:16:16PM -0600, Bob Proulx wrote:
> > Digby Tarvin wrote:
> > > My new /etc/resolv.conf is coming up as:
> > > nameserver 127.0.0.1
> >
> > This is correct if you have bind9 installed. Since this is
> > automatically detected then I assume that you do have bind9 installed
> > in order to see this result. If you remove bind9 then you would see
> > the DHCP nameserver addresses there.
> >
> > In which case there is one manual step to installing resolvconf. You
> > would need to change:
> >
> > include "/etc/bind/named.conf.options";
> >
> > To this:
> >
> > include "/var/run/bind/named.options";
> >
> > The resolvconf package scripts know about bind9 and if it is installed
> > then they assume that you want to use it and automatically set up
> > /var/run/bind/named.options with the nameservers offered by DHCP.
> >
> > Bob
>
> Aha! Yes, that was it. Thanks!
>
> Just removing bind9 was enough to produce the expected behaviour.

Yes, but "your expected" != "my expected". :-)

> Not sure I follow the bit about the manual step required. Which file
> is it that is being edited? can't find anything in etc/resolvconf..

See the /usr/share/doc/resolvconf/README.gz file for the details:

3.5 bind9
* Change the /etc/bind/named.conf file so that it includes
/var/run/bind/named.options instead of /etc/bind/named.conf.options.

> Or is that a step which would allow use of the DHCP values with bind9
> still isntalled?

Yes. That is exactly what it allows. Then you get all of the
benefits of a caching nameserver.

> I suppose the latter would be useful to be able to do, so that all my
> servers could be configured to run off a single nameserver, but be
> able to take over as the nameserver with a simple change of config
> if desired. (I am setting one up for a friend that wants to give
> debian a try, but is not experienced in Linux admin, so fairly simple
> but flexible network adaptability would be a big advantage)

Not quite. That isn't really what this particular step is doing.
Certainly bind9 can be configured to forward to a specific set of
nameservers but that would be a separate and unrelated step.

What this step is doing is configuring bind9 to use the resolvconf
updated list of dhcp offered nameservers. The bind9 named will then
act as a caching nameserver forwarding to them.

When the network interface is brought up or down then resolvconf runs
hook scripts that will update whatever needs to be updated. The list
of dhcp nameservers is one of the pieces of data that gets updated.

Bob


All times are GMT. The time now is 05:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.