Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
blank resolv.conf after some time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
net
n00b
n00b


Joined: 18 Mar 2006
Posts: 5

PostPosted: Thu Apr 24, 2014 7:07 pm    Post subject: blank resolv.conf after some time Reply with quote

for some time I use a amd64 setup.

Code:

Linux gentoo-x64-src 3.12.13-gentoo #2 SMP Sun Apr 13 20:59:30 CEST 2014 x86_64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz GenuineIntel GNU/Linux


and lose the resolv.conf after some time. It can work for 1 day or 1 week.
It never worked correctly with this or older kernels.

my /etc/conf.d/net is :
Code:

config_eth0="dhcp"
dhcp_eth0="nontp nonis"


when it happen i get:
Code:

!!! getaddrinfo failed for 'rsync.fr.gentoo.org': [Errno 111] Connection refused

and resolv.conf is empty:
Code:

gentoo-x64-src ~ # cat /etc/resolv.conf
gentoo-x64-src ~ #


to resolve it, i restart the interface:
Code:

gentoo-x64-src ~ # /etc/init.d/net.eth0 restart
 * Bringing down interface eth0
 *   Stopping dhcpcd on eth0 ...                                                                [ ok ]
 * Bringing up interface eth0
 *   dhcp ...
 *     Running dhcpcd ...
dhcpcd[21743]: sending commands to master dhcpcd process                                        [ ok ]
 *     received address                                                                         [ ok ]
gentoo-x64-src ~ #
gentoo-x64-src ~ # cat /etc/resolv.conf
# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
domain sk.loc
nameserver 192.168.0.200
# /etc/resolv.conf.tail can replace this line
gentoo-x64-src ~ #


The ip is always good

The DHCP server:
Code:

Linux sk-srv 3.12.13-gentoo #1 Thu Mar 27 22:32:47 CET 2014 i686 Intel(R) Pentium(R) 4 CPU 2.00GHz GenuineIntel GNU/Linux
[ebuild   R    ] net-misc/dhcp-4.2.5_p1-r2  USE="client ldap server ssl -ipv6 (-selinux) -vim-syntax"


Any idea about that ?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Sat Apr 26, 2014 3:46 am    Post subject: Reply with quote

assuming nameserver 192.168.0.200 is correct
Code:
echo "nameserver 192.168.0.200" > /etc/resolv.conf.head
echo "nameserver 8.8.8.8" >> /etc/resolv.conf.head

or
/etc/conf.d/net:
Quote:
dns_servers="192.168.0.200 8.8.8.8"
config_eth0="dhcp"
dhcp_eth0="nontp nonis nodns"


may or may not fix the problem since the cause of the erasure is not known.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
net
n00b
n00b


Joined: 18 Mar 2006
Posts: 5

PostPosted: Sat Apr 26, 2014 5:11 pm    Post subject: Reply with quote

Good workaround, but I need to make it work with DNS pushed by the DHCP server.

What can I try to grab more informations:
Network trace, Kernel parameter,.... ?

One more information : It run as VM in a VMware Workstation 10.0.2 on a Windows 8.1 Pro, 64-bit PC
Should move to a ESX farm later
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Sat Apr 26, 2014 7:49 pm    Post subject: Reply with quote

dmesg
/var/log/rc.log after enabling logging in /etc/rc.conf
run wireshark or the like on the interface
_________________
Defund the FCC.
Back to top
View user's profile Send private message
queen
Veteran
Veteran


Joined: 19 Jul 2005
Posts: 1642

PostPosted: Sat Apr 26, 2014 8:57 pm    Post subject: Reply with quote

DONAHUE wrote:
assuming nameserver 192.168.0.200 is correct
Code:
echo "nameserver 192.168.0.200" > /etc/resolv.conf.head
echo "nameserver 8.8.8.8" >> /etc/resolv.conf.head

or
/etc/conf.d/net:
Quote:
dns_servers="192.168.0.200 8.8.8.8"
config_eth0="dhcp"
dhcp_eth0="nontp nonis nodns"


may or may not fix the problem since the cause of the erasure is not known.


I have the same problem with /etc/resolv.conf. My workaround is to copy a backup of the nameservers that I have, into /etc/resolv.conf. I don't know why it gets empty.
Back to top
View user's profile Send private message
net
n00b
n00b


Joined: 18 Mar 2006
Posts: 5

PostPosted: Fri May 09, 2014 9:00 pm    Post subject: Reply with quote

I found this in the logs:

May 9 21:42:39 gentoo-x64-src dhcpcd[3301]: eth0: IAID 29:4c:d9:c1
May 9 21:42:39 gentoo-x64-src dhcpcd[3301]: eth0: IAID conflicts with one assigned to eth0
May 9 21:42:39 gentoo-x64-src dhcpcd[3301]: eth0: rebinding lease of 192.168.0.103
May 9 21:42:39 gentoo-x64-src dhcpcd[3301]: lo: unsupported interface type 00, falling back to ethernet
May 9 21:42:39 gentoo-x64-src dhcpcd[3301]: lo: IAID 00:00:01:00
May 9 21:42:39 gentoo-x64-src dhcpcd[3301]: lo: needs a clientid to configure
May 9 21:42:42 gentoo-x64-src kernel: [523345.765316] dhcpcd[3301]: segfault at 60a2 ip 00000000004119cf sp 00007fff0a2a2eb0 error 4 in dhcpcd[400000+1d000]

my /etc/conf.d/net file
Code:

config_eth0="dhcp"
dhcp_eth0="nontp nonis"


result of /etc/init.d/net.eth0 restart
Code:

gentoo-x64-src ~ # /etc/init.d/net.eth0 restart
 * Caching service dependencies ...                                                             [ ok ]
 * Bringing down interface eth0
 *   Caching network module dependencies
need firewalld
 * Bringing up interface eth0
 *   dhcp ...
 *     Running dhcpcd ...
dhcpcd[24275]: control_open: Connection refused
dhcpcd[24275]: version 6.2.0 starting
dhcpcd[24275]: eth0: waiting for carrier
dhcpcd[24275]: eth0: carrier acquired
dhcpcd[24275]: DUID 00:01:00:01:1a:dd:b9:44:00:0c:29:4c:d9:c1
dhcpcd[24275]: eth0: IAID 29:4c:d9:c1
dhcpcd[24275]: eth0: soliciting a DHCP lease
dhcpcd[24275]: eth0: offered 192.168.0.103 from 192.168.0.200
dhcpcd[24275]: eth0: leased 192.168.0.103 for 300 seconds
dhcpcd[24275]: eth0: adding route to 192.168.0.0/24
dhcpcd[24275]: eth0: adding default route via 192.168.0.254
dhcpcd[24275]: forked to background, child pid 24307                                            [ ok ]
 *     received address 192.168.0.103/24                                                        [ ok ]


Any idea ?
Back to top
View user's profile Send private message
vaxbrat
l33t
l33t


Joined: 05 Oct 2005
Posts: 731
Location: DC Burbs

PostPosted: Sat May 10, 2014 5:51 am    Post subject: dhcp will mod /etc/resolv.conf Reply with quote

One thing to note is that the dhcp setup will modify the /etc/resolv.conf file based on "option" records that got put into the lease pool that it manages. It looks like your dhcp server has an option record for the default route but maybe not ones that set the domain-name nor the dns-name-servers. That will tend to whack you with a blank resolv.conf file.

Another possible culprit is network-mangler (err, network-manager) but that tends to only rear its ugly head around my Redhat and Fedora boxes.

If your dhcp servers are brain dead, you might try putting something like the following into your /etc/conf.d/net file:

Code:

dns_domain_eth0="example.com"
dns_servers_eth0="xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz"
dns_search_eth0="example.com"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Sat May 10, 2014 8:40 am    Post subject: Reply with quote

net,
The following /etc/dhcp/dhcpd.conf covers my wireless segment
Code:
# wireless
# lease times from 1 to 4 hours
# option interface-mtu 1492 for PPoE
subnet 192.168.54.0 netmask 255.255.255.0 {
        range 192.168.54.220 192.168.54.239;
        default-lease-time 3600;
        max-lease-time 14400;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.54.255;
        option routers 192.168.54.253;
        option interface-mtu 1492;
        }


Globally I have
Code:
# we could run unbound and do our own dns but we don't
option domain-name "example.org";
option domain-name-servers 212.23.3.100,212.23.6.100;

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum