Linux Archive

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

tyler 01-24-2009 05:02 PM

resolv.conf getting erased
 
An update to the problem discussed below: on connecting to my wireless
with dhclient ath0, I saw a warning that /etc/resolv.conf was not a
symlink to /etc/resolvconf/run/resolv.conf. This was a consequence of
having to manually correct /etc/resolv.conf to point at my wireless
router for dns.

So I deleted /etc/resolv.conf, and replaced it with a symlink to
/etc/resolvconf/run/resolv.conf, after confirming that this target did
contain correct dns info. Twice in the last half hour since doing this,
this file has been cleared - only the comment lines at the top remain,
all the dns info is gone. This breaks my internet connection, or at
least my ability to resolve addresses.

Calling dhclient ath0 restores the file, but this is getting really
annoying. Any idea how I find out what is messing up my resolv.conf
files?

Thanks,

Tyler


tyler <tyler.smith@mail.mcgill.ca> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I recommend you install resolvconf (maybe it's installed already) and
>> then you can place a script in /etc/resolvconf/update-libc.d which
>> will be run whenever your resolv.conf file is modified (by getting
>> some data from DHCP typically). I use this to automatically switch my
>> Postfix smarthost depending on where I am.
>
> Thanks, I'll look into this.
>
>>
>>> Even after I explicitly call dhclient ath0 the contents of
>>> /etc/resolv.conf stay pointed at the dns servers for my work server.
>>> Any tips as to why this doesn't work anymore? I've posted my dhclient
>>> config below, in case that's helpful.
>>
>
> I don't think I changed the defaults, and I do get an IP address on
> ath0, but it doesn't do me any good until I manually correct the
> resolv.conf file to point at the dns server on my router. The strange
> thing is, dhclient *does* modify resolv.conf, changing the search line
> from
>
> search SMUNET.SMU.CA
>
> to
>
> search SMUNET.SMU.CA, no-domain-set.aliant
>
> which is, it adds my home domain, but doesn't delete my work domain, and
> it leaves the nameserver lines pointing at my work dns.
>
> ??
>
> Thanks,
>
> Tyler

--
When in doubt, use brute force.
--Ken Thompson


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

Celejar 01-25-2009 03:40 AM

resolv.conf getting erased
 
On Sat, 24 Jan 2009 14:02:00 -0400
tyler <tyler.smith@mail.mcgill.ca> wrote:

...

> annoying. Any idea how I find out what is messing up my resolv.conf
> files?

I'm no guru, but perhaps the audit package can help?

http://www.cyberciti.biz/tips/linux-audit-files-to-see-who-made-changes-to-a-file.html

Celejar
--
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator


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

tyler 01-25-2009 06:13 PM

resolv.conf getting erased
 
Celejar <celejar@gmail.com> writes:

>> annoying. Any idea how I find out what is messing up my resolv.conf
>> files?
>
> I'm no guru, but perhaps the audit package can help?

Thanks for all the tips, on and off-list. I noticed that at the same
time as my resolv.conf was getting cleared, something was bringing up
the eth0 interface. After much poking and prodding, I found that
commenting out the allow-hotplug lines associated with eth0 in my
/etc/network/interfaces, ie:

# The primary network interface
# allow-hotplug eth0
# iface eth0 inet dhcp

seems to have solved the problem. This is something I was messing with
months ago, and I have no idea why (or if!) the associated behaviour
changed now. Anyways, things seem to be working fine now. We'll see what
happens when I plug into eth0 at work tomorrow.

Cheers,

Tyler

--
The contents of this message have been carefully examined by skilled
artisans to ensure that only the purest, archival-quality, virus-free
bits have been used in its construction.


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

Osamu Aoki 01-26-2009 12:37 PM

resolv.conf getting erased
 
On Sun, Jan 25, 2009 at 03:13:53PM -0400, tyler wrote:
> Celejar <celejar@gmail.com> writes:
>
> >> annoying. Any idea how I find out what is messing up my resolv.conf
> >> files?
> >
> > I'm no guru, but perhaps the audit package can help?
>
> Thanks for all the tips, on and off-list. I noticed that at the same
> time as my resolv.conf was getting cleared, something was bringing up
> the eth0 interface. After much poking and prodding, I found that
> commenting out the allow-hotplug lines associated with eth0 in my
> /etc/network/interfaces, ie:
>
> # The primary network interface
> # allow-hotplug eth0
> # iface eth0 inet dhcp
>
> seems to have solved the problem. This is something I was messing with
> months ago, and I have no idea why (or if!) the associated behaviour
> changed now. Anyways, things seem to be working fine now. We'll see what
> happens when I plug into eth0 at work tomorrow.

Are you rebooting system or restarting by hand.

You may want to automate this ...
http://people.debian.org/~osamu/pub/getwiki/html/ch06.en.html#automaticnetworkconfiguration


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

tyler 01-30-2009 03:30 PM

resolv.conf getting erased
 
tyler <tyler.smith@mail.mcgill.ca> writes:

> Thanks for all the tips, on and off-list. I noticed that at the same
> time as my resolv.conf was getting cleared, something was bringing up
> the eth0 interface. After much poking and prodding, I found that
> commenting out the allow-hotplug lines associated with eth0 in my
> /etc/network/interfaces, ie:
>
> # The primary network interface
> # allow-hotplug eth0
> # iface eth0 inet dhcp
>
> seems to have solved the problem. This is something I was messing with
> months ago, and I have no idea why (or if!) the associated behaviour
> changed now. Anyways, things seem to be working fine now. We'll see what
> happens when I plug into eth0 at work tomorrow.
>

I've been working at home all week, just plugged into my work eth0. On
resuming from hibernate to disk, only the lo interface was up. I plugged
in the ethernet cable and called ifconfig eth0 up. The eth0 network was
up, without an IP, and I also had an entry for eth0:avahi:

eth0:avahi Link encap:Ethernet HWaddr 00:16:d3:29:0d:aa
inet addr:169.254.5.190 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:16

I then called dhclient eth0, and got an IP on eth0. Everything then
seemed to be working, but dns lookups were slow. So I checked
resolv.conf, and this time, instead of being cleared of all useful info,
it had the dns servers for my work network *and* my home router:

tyler:~-> cat /etc/resolvconf/run/resolv.conf
# 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 192.168.2.1
nameserver 140.184.1.21
nameserver 140.184.1.22
search no-domain-set.aliant SMUNET.SMU.CA

So now I've got the opposite problem as before - instead of having
resolv.conf properly updated, I'm getting the new info appended. Which
means I still have to edit the file by hand. Any ideas what's wrong
would be most helpful!

I will eventually look into automating more of this, but I would like to
understand what's going on at a lower level, hence my current efforts to
sort this out at with dhclient and ifconfig.

Cheers,

Tyler

--
I never loan my books, for people never return them. The only books
remaining in my library are those I’ve borrowed from others.
--unknown


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

John Hasler 01-30-2009 03:47 PM

resolv.conf getting erased
 
Tyler writes:
> So now I've got the opposite problem as before - instead of having
> resolv.conf properly updated, I'm getting the new info appended. Which
> means I still have to edit the file by hand. Any ideas what's wrong would
> be most helpful!

I'd start by removing resolvconf as well as network-manager and avahi if
they are installed.
--
John Hasler


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


All times are GMT. The time now is 11:57 PM.

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