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 (Got an idea!)
Date: Sun, 27 Jul 2014 14:55:48
Message-Id: CACE6sH==f=oHyTb=0FhSGa2SFovn+8QWnvWM4EO0rdsUrwm-cQ@mail.gmail.com
1 2014-07-27 14:30 GMT+03:00 Grand Duet <grand.duet@×××××.com>:
2 > 2014-07-27 13:39 GMT+03:00 Walter Dnes <waltdnes@××××××××.org>:
3 >> On Sun, Jul 27, 2014 at 12:21:23PM +0300, Grand Duet wrote
4 >>> This is a continuation of the thread:
5 >>> "Something went wrong with DNS, plz help!"
6 >>>
7 >>> Now, the issue became clearer, so I decided to start
8 >>> a new thread with more descriptive Subject.
9 >>>
10 >>> In short: the contents of the file /etc/resolv.conf
11 >>> is unpredictably different from one reboot to another.
12 >>> It is either
13 >>> # Generated by net-scripts for interface lo
14 >>> domain mynetwork
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 >>> I tried to chmod this file to be unwrittable even for root
22 >>> but after a reboot it have been overwritten anyway.
23 >>>
24 >> A similar problem was noted at...
25 >> https://forums.gentoo.org/viewtopic-t-816332-start-0.html
26 >
27 > Like in the thread above, I also have a line
28 > dns_domain_lo="mynetwork"
29 > in my /etc/conf.d/net file. It says nothing to me
30 > and I do not remember how it got there.
31 >
32 > But somewhere on Gentoo forum I have found the following
33 > explanation: "If you only specify dns_domain_lo="foo" and
34 > restart the lo interface it will put "domain foo" in /etc/resolv.conf
35 > and remove everything else."
36 >
37 > So, I guess I should try to remove that line from my /etc/conf.d/net file.
38 >
39 > But why the system worked fine for about a year *with* this line then?
40
41 Well, after finishing my main job, I finally got an idea
42 why everything went wrong after the last system update.
43
44 During my last system update, portage instructed me to add
45 dev-lang/tk-8.5.15 threads
46 line to my /etc/portage/package.use file.
47
48 Here is the portage message about it:
49
50 The following USE changes are necessary to proceed:
51 (see "package.use" in the portage(5) man page for more details)
52 # required by dev-lang/ruby-1.9.3_p484[tk]
53 # required by dev-ruby/rake-0.9.6[ruby_targets_ruby19]
54 # required by dev-lang/ruby-2.0.0_p353
55 # required by dev-ruby/racc-1.4.9[ruby_targets_ruby20]
56 # required by dev-ruby/rdoc-4.0.1-r1[ruby_targets_ruby19]
57 =dev-lang/tk-8.5.15 threads
58
59 And in my /etc/portage/package.use file this line has already
60 been commented. So, I just uncommented it. But I do remember
61 that it was commented for a reason, though do not remember
62 exactly why.
63
64 May be uncommenting that line allowed bringing up
65 lo and eth0 interfaces *in parallel*. If it is the case,
66 then I have an easy explanation why the contents
67 of /etc/resolv.conf file after boot is unpredictable.
68
69 If eth0 starts after lo, then I have the right /etc/resolv.conf
70 file, however if lo starts after eth0, then the DNS IPs in
71 resolv.conf file are overwritten with dummy instruction
72 for lo interface.
73
74 What do you think?
75
76 >> Can you post the contents of your /etc/conf.d/net
77 >
78 > hostname="myhostname"
79 > dns_domain_lo="mynetwork"
80 >
81 > config_eth0="My.Local.IP netmask My.Net.Mask broadcast
82 > Broadcast.IPof.My.LocalNetwork"
83 > routes_eth0="default via Local.IPof.My.Gateway"
84 >
85 > dns_servers_eth0="My.First.DNS.IP My.Second.DNS.IP 8.8.8.8"
86 >
87 > mtu_eth0="1500" # if needed
88 >
89 > # The network scripts are now part of net-misc/netifrc
90 > # In order to avoid sys-apps/openrc-0.12.4 from removing this file,
91 > this comment was
92 > # added; you can safely remove this comment. Please see
93 > # /usr/share/doc/netifrc*/README* for more information.
94 >
95 >> and also the output of the "rc-update show" command?
96 >
97 > # rc-update show
98 > alsasound | boot
99 > bootmisc | boot
100 > dbus | default
101 > devfs | sysinit
102 > dmesg | sysinit
103 > fsck | boot
104 > hostname | boot
105 > hwclock | boot
106 > keymaps | boot
107 > killprocs | shutdown
108 > kmod-static-nodes | sysinit
109 > local | default
110 > localmount | boot
111 > loopback | boot
112 > metalog | default
113 > modules | boot
114 > mount-ro | shutdown
115 > mtab | boot
116 > net.eth0 | default
117 > net.lo | boot
118 > netmount | default
119 > privoxy | default
120 > procfs | boot
121 > root | boot
122 > savecache | shutdown
123 > swap | boot
124 > swapfiles | boot
125 > sysctl | boot
126 > sysfs | sysinit
127 > termencoding | boot
128 > tmpfiles.dev | sysinit
129 > tmpfiles.setup | boot
130 > udev | sysinit
131 > udev-mount | sysinit
132 > urandom | boot
133 >
134 > Everywhere above eth0 has been put instead of its udev "predictable" name.
135 >
136 > Do you think that I need
137 > carrier_timeout_eth0=20
138 > somewhere in /etc/conf.d/net ?
139 >
140 > Thank you.
141 >
142 >> That should help narrow down the potential sources of your problem.