Bug 55173 - hostname set by dhcp can't be resolved
Summary: hostname set by dhcp can't be resolved
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: dhcpcd (Show other bugs)
(Show other bugs)
Version: 7.2
Hardware: All Linux
Target Milestone: ---
Assignee: Elliot Lee
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2001-10-26 16:29 UTC by John
Modified: 2007-04-18 16:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-06-28 17:05:06 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description John 2001-10-26 16:29:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:0.9.2) Gecko/20010802

Description of problem:
On a fresh install of RH 7.2, dhcp was enabled.  No hostname (or any other
network related field) was set.  I can ssh to machines on the net just
fine, however, "ping `hostname`" doesn't work!  fetchmail fails saying it
can't "gethostbyname for xxx," where xxx is the hostname set by dhcp.  (If
it helps, xxx is _not_ fully qualified... it is xxx, rather than
xxx.twcny.rr.com, which would be the fully qualified name.)

Also, gdm doesn't start at boot even though I requested a graphical login
screen.  In addition to that, when starting a GNOME session using startx,
GNOME reports that the hostname can't be resolved, so some things won't
work correctly.  (I don't remember GNOME's error message off of the top of
my head... I'm at a different workstation right now.)

Also, /etc/hosts isn't being updated with the new hostname & ip address. 
(This seems to be the root of the problem.)

The summary is, RH 7.2 doesn't work out of the box with my cable modem

(It's not going to be a big fix, and I can probably hack around it for my
own machine, but I'd like to know the right way to do it, and I figured you
guys would want to know to update the dhcp scripts or the installer to make
things work without any effort by the end user. :)

Thanks for looking into this!


p.s.  The rest of 7.2 looks very smooth. :)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Plug the box into my dhcp cable modem network.
2.  Install RH 7.2, and let dhcp set all network info
3.  Try to start a GNOME session, ping `hostname`, or run fetchmail.

Additional info:

Comment 1 mwalton 2001-10-26 20:35:57 UTC
I am having exactly the same problem, and everything worked fine with redhat 7.0
and 7.1, so its a bit weird. I would be glad to know of the proper fix. For the
time being i am just setting hostname manually.

Comment 2 mwalton 2001-10-26 23:11:57 UTC
In the file /etc/sysconfig/network-scripts/ifup, I commented out the line:


This stops dhcpcd from setting the hostname. The initscripts then use some other
method to set the hostname, which I assume was what happened before redhat 7.2.
In my case this fix works perfectly.

Comment 3 Jean Berthomieu 2001-10-28 00:44:12 UTC
One of the scripts involved by "/etc/init.d/network start" rewrites 
/etc/resolv.conf setting "domain" and "search" and "nameserver". If your ISP 
dhcpd did it wrong (e.g. mine sets my IP to resolve as "xxxxx.abo.wanadoo.fr" 
but sets my "domain" (and "search") as "wanadoo.fr". So several services such 
as "lpd", "gdm", "fetchmail"(?) will not start. The fix could be not to 
rewrite the "search" parameter at least: Most sysadmins do know what to search!

Comment 4 Elliot Lee 2002-01-04 19:44:16 UTC
I do believe this is fixed in the latest initscripts/dhcpcd - please try them
out of rawhide (may need to rebuild).

Comment 5 Brian "netdragon" Bober 2002-06-03 04:28:24 UTC
I am having the same problem with Redhat v7.2. I have been on two separate cable
ISPs, and both ISPs had the same problem (Roadrunner and Cox).

I also get that error on Gnome startup, and can't ping my hostname. I could fix
the problem (temporarily) by going into the "Network configuration wizard" and
removing some of the entries on the DNS tab and rebooting. It doesn't seem to
work anymore, though.

My domain name is:

My hostname changes on occasion and so does my ip, so I can't add that to
/etc/hosts without having to change it each time.

where the XXX represents numbers.

I also have problems with X server saying unknown host on startup and proftpd
saying it can't find the domain name for a particular ip.

Here is a thread where some talking has gone on about the issue:

It also contains some information about my setup (my name is netdemon on it and
my posts start on the second page).

Unfortunately, no one could help me there.

From what I found from searching the web, this problem is very widespread for
people without routers on many distributions:

No one was able to help me in irc.openprojects.org #redhat.

Please come up with a solution. This is really aggravating :-(

Comment 6 Brian "netdragon" Bober 2002-06-03 05:10:32 UTC
mwalton: What you did seemed to solve my problem. Do you think that the command
"dhcpcd -H" has a bug? I don't really understand dhcp that well, so I wouldn't
know the answer to that question.I have seen this happen to people on even BSD,
so I assume that it is a problem with certain ISPs that might be somewhat new
due to changes in the way the ISPs operate (or maybe a regression in the code).

Comment 7 Brian "netdragon" Bober 2002-06-03 05:35:50 UTC
sopwith: If the problem seems to be the dhcpcd utilities on all Unix systems,
what do you mean by initscripts/dhcpcd? I might be wrong (which I problably am),
but the problem seems to appear in /sbin/dhcpcd -H

Comment 8 Scott R. Godin 2002-06-04 05:12:31 UTC
I'm on 7.2 here, and connected to comcast.net 

1:06am {21} pcp01487252pcs:/var/log># cat

both originally and currently, setting the DHCP_HOSTNAME in this file caused me
to have the correct hostname .. originally it was cn2473162-a, but currently
comcast changed how its dhcp works, and now no longer needs the client-id set,
other than that it does need to have *something* there (could be a random string
of chars like ahsjdgajgd) 

currently I get :
12:55am {20} pcp01487252pcs:/var/log># hostname

and that varies over time ultimately since I am on dynamic IP. 

I also have echo "1" > /proc/sys/net/ipv4/ip_dynaddr
 set in /etc/rc.d/rc.local

I can't think of anything else I changed. nothing in /etc/hosts gets changed by
this. my  /etc/resolv.conf  looks like this: 

domain limstn01.de.comcast.net
search limstn01.de.comcast.net

I can't recall whether I set that manually or whether the system configured that
on its own at boot time. it just works. the problem may be with your cable
providers. not sure. This worked on an old 486 DX-2/66 with ancient ISA RealTek
8019a card, and currently with ne2k-pci-driver and 8139too-driver using PCI
cards in the new Duron 1.1Ghz box. 

Note You need to log in before you can comment on or make changes to this bug.