Gentoo Archives: gentoo-user

From: Grand Duet <grand.duet@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] resolv.conf is different after every reboot
Date: Sun, 27 Jul 2014 13:39:37
Message-Id: CACE6sH=M=0JN_Hf2viSRW7QAeh8onoH=xCuThu47u2n=OAFS4A@mail.gmail.com
In Reply to: Re: [gentoo-user] resolv.conf is different after every reboot by Matti Nykyri
1 2014-07-27 16:10 GMT+03:00 Matti Nykyri <matti.nykyri@×××.fi>:
2 >> On Jul 27, 2014, at 13:33, Grand Duet <grand.duet@×××××.com> wrote:
3 >>
4 >> 2014-07-27 12:29 GMT+03:00 Neil Bothwick <neil@××××××××××.uk>:
5 >>>> On Sun, 27 Jul 2014 12:21:23 +0300, Grand Duet wrote:
6 >>>>
7 >>>> In short: the contents of the file /etc/resolv.conf
8 >>>> is unpredictably different from one reboot to another.
9 >>>> It is either
10 >>>> # Generated by net-scripts for interface lo
11 >>>> domain mynetwork
12 >>>
13 >>> That's what you get when lo comes up.
14 >>>
15 >>>> or
16 >>>> # Generated by net-scripts for interface "eth0"
17 >>>> nameserver My.First.DNS-Server.IP
18 >>>> nameserver My.Second.DNS-Server.IP
19 >>>> nameserver 8.8.8.8
20 >>>
21 >>> That's what replaces it when eth0 comes up.
22 >>> It looks like eth0 is not being brought up fully
23 >>
24 >> It sounds logical. But how can I fix it?
25 >>
26 >> Can carrier_timeout_eth0= setting in /etc/conf.d/net file help?
27 >> If so, how much seconds should I use?
28 >>
29 >>> what do your logs say?
30 >>
31 >> Could you, please, be more precise where to look for "logs".
32 >>
33 >>> It might be worth putting logger commands in preup(),
34 >>> postup() and failup() in conf.d/net.
35 >>
36 >> Currently, I have no such functions in my /etc/conf.d/net file.
37 >> Shall I copy them there from
38 >> /usr/share/doc/netifrc-0.2.2/net.example
39 >>
40 >> Could you, please, be more specific on these "logger commands" too.
41 >>
42 >>>> I tried to chmod this file to be unwrittable even for root
43 >>>> but after a reboot it have been overwritten anyway.
44 >>>
45 >>> You can't stop root overwriting a file, root laughs in the face of file
46 >>> permissions.
47 >>>
48 >>> BTW, I'm not sure if it's still relevant, but I don't think you ever
49 >>> posted the contents of /etc/resolvconf.conf, if it exists.
50 >>
51 >> I do not have such file. Of course, if you do not mean /etc/resolv.conf
52 >> But I have posted its content above.
53 >>
54 >
55 > Depending on your filesystem a temporary solution to your problem is to setup /etc/resolv.conf correctly and then:
56 > chattr +i /etc/resolv.conf
57 >
58 > After that the content of the file will not change.
59
60 Thank you. I will try it if deleting the line
61 dns_domain_lo="mynetwork"
62 from my /etc/conf.d/net file will not work.
63
64 But does chattr +i differ from chmod a-w ?
65 (The latter did not work for me. I use ext4 file system.)

Replies

Subject Author
Re: [gentoo-user] resolv.conf is different after every reboot Matti Nykyri <matti.nykyri@×××.fi>