View previous topic :: View next topic |
Author |
Message |
James Wells n00b
Joined: 10 Sep 2004 Posts: 57
|
Posted: Wed Aug 16, 2006 2:31 am Post subject: SOLVED: Very strange hostname / DHCP issue |
|
|
Greetings,
I have recently begun having a strange problem on my laptop, when my system loses it's hostname entries after I start the wireless network.
To test this, I have run various combinations of hostname -a, hostname -f, etc. Before I bring up my wireless network, they all show the correct hostname and domainname combinations, however, after dhcp completes for my wireless device, all hostname entries fail. This causes various other things to fail my syslog-ng, kdeinit, sendmail, and a few others.
If I run /etc/init.d/hostname restart after dhcp completes for my wireless, everything works correctly, assuming that I haven't yet started any of the affected processes.
EDIT: I got around the issue by commenting out lines 135 - 146 in dhcp-3.0.5_beta1's /sbin/dhclient-script.
Last edited by James Wells on Sat Aug 19, 2006 2:33 am; edited 1 time in total |
|
Back to top |
|
|
magic919 Advocate
Joined: 17 Jun 2005 Posts: 2182 Location: Berkshire, UK
|
Posted: Wed Aug 16, 2006 7:47 am Post subject: |
|
|
It's worth sticking your FQDN in the hosts file if you haven't already. |
|
Back to top |
|
|
James Wells n00b
Joined: 10 Sep 2004 Posts: 57
|
Posted: Thu Aug 17, 2006 12:36 am Post subject: |
|
|
Yup. In my /etc/hosts file I have;
127.0.0.1 <MyLaptop FQDN> <MyLaptop> localhost.localdomain localhost
Something else I just noticed is that when I run DHCP at home, I get the same host as I have configured in my /etc/hosts so I have not issues there. Is there a way to tell dhcp not to set the hostname? I can see there is an option not to send the hostname, but I see nothing about not setting the hostname. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
OldTango l33t
Joined: 21 Feb 2004 Posts: 718
|
Posted: Thu Aug 17, 2006 2:56 pm Post subject: |
|
|
I need some assistance getting my network working properly again after a world update.
I am using dhcpcd for eth0 on the server to get an IP form my ISP and using DHCP (via eth1) to assign IP's automatically to the machines on the lan which are using dhcpcd to get their IP's
When I reboot the server I get a message telling me I need to update my /etc/conf.d/net file because I am using old style syntax. After reading the net.example file and changing some settings I can get eth0 to come up and get and IP but still get this errror message. Eth0 now comes up and gets an IP (via DHCP). DHCP fails to run (no error message) and eth1 comes up but dosen't get an IP.
Before my clients on the lan can use the internet or connect to the server I have to manually run Code: | ifconfig eth1 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0 up | every time.
I followed this little how-to http://www.gentoo.org/doc/en/home-router-howto.xml a couple of years ago to help set up my server but never used the built-in dhcp server in dnsmasq because I had installed DHCP and it was working just fine untill recently.
However things in gentoo have changed recently and now I need to deal with these error messages and get my server working correctly again.
TIA |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
magic919 Advocate
Joined: 17 Jun 2005 Posts: 2182 Location: Berkshire, UK
|
Posted: Thu Aug 17, 2006 3:02 pm Post subject: |
|
|
Did someone remove the New Topic button?? |
|
Back to top |
|
|
James Wells n00b
Joined: 10 Sep 2004 Posts: 57
|
Posted: Sat Aug 19, 2006 2:30 am Post subject: |
|
|
UberLord wrote: | Depends on which dhcp client you use. So which one is it? |
Using dhcp-3.0.5_beta1.
Anyway, I found what was causing the issue, though I am unsure whether this is intentional or accidental. In /sbin/dhclient-script, around line 135, the client script checks to see if the current hostname is different from the dhcp assigned name. If they are different, then it sets the hostname to the dhcp assigned name. While I can see where this would be valuable, I think it would be even better if there was a way to disable this, short of commenting the offending lines out as I have done to get around the issue. |
|
Back to top |
|
|
lbrtuk l33t
Joined: 08 May 2003 Posts: 910
|
Posted: Sat Aug 19, 2006 3:29 am Post subject: |
|
|
From /etc/conf.d/net.example:
Code: | # GENERIC DHCP OPTIONS
# Set generic DHCP options like so
#dhcp_eth0="release nodns nontp nonis nogateway nosendhost"
# This tells the dhcp client to release it's lease when it stops, not to
# overwrite dns, ntp and nis settings, not to set a default route and not to
# send the current hostname to the dhcp server and when it starts.
# You can use any combination of the above options - the default is not to
# use any of them. |
|
|
Back to top |
|
|
James Wells n00b
Joined: 10 Sep 2004 Posts: 57
|
Posted: Sat Aug 19, 2006 4:11 am Post subject: |
|
|
The option you are showing, says to send or not to send the hostname to the DHCP server. As I understand it, that option has no effect if the dhcp server sends a pre-generated name. I should also point out that I already had the nosendhost option set and still had my hostname changed on me when I recieved a DHCP option host-name entry from the DHCP server. The only time it doesn't change is when I am at home where my DHCP server sends the hostname that my laptop uses ayway. |
|
Back to top |
|
|
lbrtuk l33t
Joined: 08 May 2003 Posts: 910
|
Posted: Sun Aug 20, 2006 1:35 am Post subject: |
|
|
I was more looking at the nodns entry. If the host settings your DHCP is sending you are breaking your connection, set nodns. |
|
Back to top |
|
|
|