Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

SOLVED: Very strange hostname / DHCP issue

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
11 posts • Page 1 of 1
Author
Message
James Wells
n00b
n00b
User avatar
Posts: 57
Joined: Fri Sep 10, 2004 4:26 pm

SOLVED: Very strange hostname / DHCP issue

  • Quote

Post by James Wells » Wed Aug 16, 2006 2:31 am

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.
Top
magic919
Advocate
Advocate
Posts: 2182
Joined: Fri Jun 17, 2005 7:31 am
Location: Berkshire, UK

  • Quote

Post by magic919 » Wed Aug 16, 2006 7:47 am

It's worth sticking your FQDN in the hosts file if you haven't already.
Top
James Wells
n00b
n00b
User avatar
Posts: 57
Joined: Fri Sep 10, 2004 4:26 pm

  • Quote

Post by James Wells » Thu Aug 17, 2006 12:36 am

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.
Top
UberLord
Retired Dev
Retired Dev
User avatar
Posts: 6838
Joined: Thu Sep 18, 2003 10:26 am
Location: Blighty
Contact:
Contact UberLord
Website

  • Quote

Post by UberLord » Thu Aug 17, 2006 6:32 am

Depends on which dhcp client you use. So which one is it?
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Top
OldTango
l33t
l33t
User avatar
Posts: 739
Joined: Sat Feb 21, 2004 5:08 pm
Contact:
Contact OldTango
Website

  • Quote

Post by OldTango » Thu Aug 17, 2006 2:56 pm

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: Select all

 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
Top
UberLord
Retired Dev
Retired Dev
User avatar
Posts: 6838
Joined: Thu Sep 18, 2003 10:26 am
Location: Blighty
Contact:
Contact UberLord
Website

  • Quote

Post by UberLord » Thu Aug 17, 2006 3:01 pm

Alas my crystal ball has broken, but I suspect you are getting that message as you're still trying to use an old var such as gateway or iface_eth0
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Top
magic919
Advocate
Advocate
Posts: 2182
Joined: Fri Jun 17, 2005 7:31 am
Location: Berkshire, UK

  • Quote

Post by magic919 » Thu Aug 17, 2006 3:02 pm

Did someone remove the New Topic button??
Top
James Wells
n00b
n00b
User avatar
Posts: 57
Joined: Fri Sep 10, 2004 4:26 pm

  • Quote

Post by James Wells » Sat Aug 19, 2006 2:30 am

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.
Top
lbrtuk
l33t
l33t
User avatar
Posts: 910
Joined: Thu May 08, 2003 3:02 pm

  • Quote

Post by lbrtuk » Sat Aug 19, 2006 3:29 am

From /etc/conf.d/net.example:

Code: Select all

# 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.
Top
James Wells
n00b
n00b
User avatar
Posts: 57
Joined: Fri Sep 10, 2004 4:26 pm

  • Quote

Post by James Wells » Sat Aug 19, 2006 4:11 am

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. ;)
Top
lbrtuk
l33t
l33t
User avatar
Posts: 910
Joined: Thu May 08, 2003 3:02 pm

  • Quote

Post by lbrtuk » Sun Aug 20, 2006 1:35 am

I was more looking at the nodns entry. If the host settings your DHCP is sending you are breaking your connection, set nodns.
Top
Post Reply

11 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic