Networking Forums

Networking Forums > Computer Networking > Linux Networking > My hostname not being registered via DHCP

Reply
Thread Tools Display Modes

My hostname not being registered via DHCP

 
 
UncleStoner
Guest
Posts: n/a

 
      01-31-2005, 09:42 PM
Hello,
I'm a Linux newbie.
I have just installed Redhat Linux 8.0. I'm using DHCP to get a IP
address, DNS servers, etc. That's all working fine. The problem is,
the hostname of my linux box isn't being registered with DNS by DHCP.
The hostname of my Linux box is "seratonin", and I can't ping it from
other machines on my network (either by "seratonin" or
"seratonin.mycompany.com".

Below are all the setup files that might be relevant

/etc/hosts:
127.0.0.1 localhost.localdomain localhost seratonin

/etc/resolv.conf
; generated by /sbin/dhclient-script
search mycompany.com
nameserver 10.9.3.23
nameserver 10.9.3.22

/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=seratonin.mycompany.com

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
USERCTL=no
PEERDNS=yes
TYPE=Ethernet
DHCP_HOSTNAME=3D"seratonin.mycompany.com"

Note that for DHCP_HOSTNAME above I've tried "seratonin",
"seratonin.mycompany.com", 3D"seratonin", and leaving it out. I don't
know what the deal with the '3D' is, I saw it suggested somewhere.

Can anyone help me? It seems like it should be a pretty common
configuration.

Thanks,
Dave

 
Reply With Quote
 
 
 
 
Tommy Reynolds
Guest
Posts: n/a

 
      01-31-2005, 10:03 PM
On Mon, 31 Jan 2005 14:42:19 -0800, UncleStoner wrote:

> I'm a Linux newbie.


Hello, noob.

> I have just installed Redhat Linux 8.0.


First mistake. Install something reasonably current such as Fedora
Core 3; don't even bother with RH9 unless you have mitigating
circumstances.

> I'm using DHCP to get a IP address, DNS servers, etc.


> The problem is, the hostname of my linux box isn't being registered
> with DNS by DHCP.


Well, that's because DHCP doesn't register your hostname with DNS --
the DHCP server assigns the name and maybe tells DNS about it.

> /etc/hosts:
> 127.0.0.1 localhost.localdomain localhost seratonin


IP address 127.0.0.1 is not going to be accessible from _any_ machine
other than yours; it's not a network address: it's a local address.

> /etc/sysconfig/network
> NETWORKING=yes
> HOSTNAME=seratonin.mycompany.com


This HOSTNAME setting is so that your local machine knows its name so
you can get pretty shell prompts and the like.

> /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0
> BOOTPROTO=dhcp
> ONBOOT=yes
> USERCTL=no
> PEERDNS=yes
> TYPE=Ethernet
> DHCP_HOSTNAME=3D"seratonin.mycompany.com"


Lose the '3D': this ain't no steenkin' URL. This sets the name
_your_ machine thinks it is when using this NIC. Still have nothing
to give to DNS.

> Can anyone help me? It seems like it should be a pretty common
> configuration.


The fault lies in you DHCP server, not in your local machine. You
can set it up to provide your IP address, as you have, but to also
provide the DNS info:

host seratonin.mycompany.com {
fixed-address xxx.xxx.xxx.xxx;
}

Check the "/etc/dhcpd.conf" file on the DHCP server. Use

$ man dhcp.conf

for more details.

HTH.

 
Reply With Quote
 
prg
Guest
Posts: n/a

 
      01-31-2005, 10:13 PM

UncleStoner wrote:
> Hello,
> I'm a Linux newbie.
> I have just installed Redhat Linux 8.0. I'm using DHCP to get a IP
> address, DNS servers, etc. That's all working fine. The problem is,
> the hostname of my linux box isn't being registered with DNS by DHCP.
> The hostname of my Linux box is "seratonin", and I can't ping it from
> other machines on my network (either by "seratonin" or
> "seratonin.mycompany.com".


Unless it's an IP/domain you registered, your ISP most likely
automatically generates a name like 216-34-isps-subnet-domain. The ISP
updates DNS servers and can't be bothered with naming conflicts unless
you pay fer 'em.

> Below are all the setup files that might be relevant
>
> /etc/hosts:
> 127.0.0.1 localhost.localdomain localhost seratonin
>
> /etc/resolv.conf
> ; generated by /sbin/dhclient-script
> search mycompany.com
> nameserver 10.9.3.23
> nameserver 10.9.3.22
>
> /etc/sysconfig/network
> NETWORKING=yes
> HOSTNAME=seratonin.mycompany.com


This name only useful on localhost and on your LAN only if _you_
provide some kind of name resolution -- eg., /etc/hosts files or
dnsmasq or running bind/named on your LAN.

> /etc/sysconfig/network-scripts/ifcfg-eth0
> DEVICE=eth0
> BOOTPROTO=dhcp
> ONBOOT=yes
> USERCTL=no
> PEERDNS=yes
> TYPE=Ethernet
> DHCP_HOSTNAME=3D"seratonin.mycompany.com"


Just another form of client-id. The ISP likely ignores it in favor of
your MAC address.

> Note that for DHCP_HOSTNAME above I've tried "seratonin",
> "seratonin.mycompany.com", 3D"seratonin", and leaving it out. I

don't
> know what the deal with the '3D' is, I saw it suggested somewhere.


If you want to see the name the ISP is assigning to your computer you
will have to _not_ assign a name yourself. The name you are assigned
will be almost guaranteed ugly, very ugly, I mean really very ugly --
and will vary as/if your IP changes.

If you want a static IP and registered domain name, you will have to
buy it from your ISP or someone they work with. dyndns may provide a
way for you to have a publicly accessible name if you need that. See:
www.dyndns.org/
..
hth
prg
email above disabled

 
Reply With Quote
 
UncleStoner
Guest
Posts: n/a

 
      02-01-2005, 12:33 PM
Thanks for taking the time to reply.

> > I have just installed Redhat Linux 8.0.

>
> First mistake. Install something reasonably current such as Fedora
> Core 3; don't even bother with RH9 unless you have mitigating
> circumstances.


I've got circumstances. I'm working on an appliance product that runs
on RH8, and the development environment is also RH8 (maybe I could use
a different platform for development, but others on the project use RH8
and since I'm new to both the project and to Linux, I just want to
follow the herd for now).

> Well, that's because DHCP doesn't register your hostname with DNS --
> the DHCP server assigns the name and maybe tells DNS about it.


Maybe I'm using the word "register" to casually. I'm not sure what you
call it, but isn't it possible to get DHCP to co-operate with DNS in
order to make my DHCP client's hostname resolvable?

> > /etc/hosts:
> > 127.0.0.1 localhost.localdomain localhost seratonin

>
> IP address 127.0.0.1 is not going to be accessible from _any_ machine
> other than yours; it's not a network address: it's a local address.


Yeah, that I acutally knew, I just included it for completeness.

> The fault lies in you DHCP server, not in your local machine. You
> can set it up to provide your IP address, as you have, but to also
> provide the DNS info:


The problem is I don't control the DHCP server on the network. I
suspect it's a Windows DHCP server.

My Windows boxes have names I assign them, and they somehow make those
names resolvable on the network. I assume they do this in co-operation
with the DHCP server. However, maybe they are using some other
mechanism that is Windows-specific (blech), and so not available to
Linux.

Maybe this is all a fool's errand?

 
Reply With Quote
 
UncleStoner
Guest
Posts: n/a

 
      02-01-2005, 12:38 PM
Thanks for taking the time to reply.

I should have provided more high-level detail in my original post. I'm
actually on a corporate LAN, which hosts mostly windows boxes and whose
various services (DHCP, DNS, etc) are presumably provided by Windows as
well.

I'm one of the few people in this environment trying to get a Linux box
up. My Windows boxes all have hostnames that I assign them, and they
all use DHCP. Somehow, they are able to get their names resolvable on
the network. I assumed that they did this by sending their names to
the DHCP server when they requested an IP (and all the other stuff a
DHCP client requests from a DHCP server), and then the DHCP server did
some magic, in conjunction with the DNS server, to make those hostnames
resolvable.

 
Reply With Quote
 
Captain Dondo
Guest
Posts: n/a

 
      02-01-2005, 01:11 PM
On Tue, 01 Feb 2005 05:33:24 -0800, UncleStoner wrote:


> My Windows boxes have names I assign them, and they somehow make those
> names resolvable on the network. I assume they do this in co-operation
> with the DHCP server. However, maybe they are using some other
> mechanism that is Windows-specific (blech), and so not available to
> Linux.
>
> Maybe this is all a fool's errand?


From my limited experience, windows DHCP is either 'broken' or 'extended',
depending on which side of the fence you're on.

Windows boxes do not accept the hostname assigned by DHCP; they completely
ignore it. This wreaks havoc with my DHCP setup, which uses DDNS (dynamic
DNS) to do exactly what you are trying to do.

It would not surprise me if MS 'extended' the protocol to include the
ability for the client to tell the server its name, which would then be
added to DNS, inlcuding its FQDN. The pitfalls of this are obvious....

I don't know how to break (pardon, extend) the linux dhcp client to work
the same way as windows....

 
Reply With Quote
 
Tommy Reynolds
Guest
Posts: n/a

 
      02-01-2005, 02:06 PM
On Tue, 01 Feb 2005 05:33:24 -0800, UncleStoner wrote:

> Maybe I'm using the word "register" to casually. I'm not sure what you
> call it, but isn't it possible to get DHCP to co-operate with DNS in
> order to make my DHCP client's hostname resolvable?


Ah, the larger picture emerges. You need to get the IT gang to add
an entry into their WINS server.

HTH.

 
Reply With Quote
 
prg
Guest
Posts: n/a

 
      02-01-2005, 02:12 PM

UncleStoner wrote:
> Thanks for taking the time to reply.
>
> I should have provided more high-level detail in my original post.

I'm
> actually on a corporate LAN, which hosts mostly windows boxes and

whose
> various services (DHCP, DNS, etc) are presumably provided by Windows

as
> well.
>
> I'm one of the few people in this environment trying to get a Linux

box
> up. My Windows boxes all have hostnames that I assign them, and they
> all use DHCP. Somehow, they are able to get their names resolvable

on
> the network. I assumed that they did this by sending their names to
> the DHCP server when they requested an IP (and all the other stuff a
> DHCP client requests from a DHCP server), and then the DHCP server

did
> some magic, in conjunction with the DNS server, to make those

hostnames
> resolvable.


Ah-hah....;-)

So, you do have local dhcp/dns servers -- that's good for what you
want.

So, you are using Windows (W2K or W2K03?) for these servers -- that may
not be so good for what you want ;-)

Been some time since I've played with Windows dhcp/dns/wins running
things.

First thing that may cause a hiccup is how your LAN is setup -- NT or
AD domains -- and whether you're using WINS for Netbios name
resolution. We'll ignore those for the moment, foolishly hoping we
won't have to make special provision for them.

This provides more succinct and clearer steps of how to set up your
hostname on Linux and provides RH/FC specific guidance (and others):
http://www.cpqlinux.com/hostname.html

Give these instructions a try and see how far it gets you. Post again
with results if it's not a complete success.

You could also google something like this:
windows dhcp server host name
..
hth,
prg
email above disabled

 
Reply With Quote
 
Frank Sweetser
Guest
Posts: n/a

 
      02-02-2005, 01:50 AM
["Followup-To:" header set to comp.os.linux.networking.]
UncleStoner <(E-Mail Removed)> wrote:
> I'm one of the few people in this environment trying to get a Linux box
> up. My Windows boxes all have hostnames that I assign them, and they
> all use DHCP. Somehow, they are able to get their names resolvable on
> the network. I assumed that they did this by sending their names to


That would be Active Directory. A few web searches should give you the
basic architecture.

--
Frank Sweetser fs at wpi.edu
WPI Network Engineer
GPG fingerprint = 6174 1257 129E 0D21 D8D4 E8A3 8E39 29E3 E2E8 8CEC
 
Reply With Quote
 
Jim Patterson
Guest
Posts: n/a

 
      02-03-2005, 03:42 AM
UncleStoner wrote:
> Thanks for taking the time to reply.
>
> I should have provided more high-level detail in my original post. I'm
> actually on a corporate LAN, which hosts mostly windows boxes and whose
> various services (DHCP, DNS, etc) are presumably provided by Windows as
> well.
>
> I'm one of the few people in this environment trying to get a Linux box
> up. My Windows boxes all have hostnames that I assign them, and they
> all use DHCP. Somehow, they are able to get their names resolvable on
> the network. I assumed that they did this by sending their names to
> the DHCP server when they requested an IP (and all the other stuff a
> DHCP client requests from a DHCP server), and then the DHCP server did
> some magic, in conjunction with the DNS server, to make those hostnames
> resolvable.


DHCP and DNS is not likely how the Windows machines are discovering each
other; it's usuall based on NETBIOS naming (though Windows does use DNS
as well).

You should be able to do the same from your RH8 box wit a little work:

- Run SAMBA on your RH8 box. Just running the SAMBA server should be
enough to get it to broadcast your hostname so other Windows machines
will see it. However, you may need to do some configuration depending on
how your LAN is set up (check out the Samba docs or http://www.samba.org
for info).

- Set up your own name resolution mechanism to check "wins". You can do
this by editing the file /etc/nsswitch.conf . Look for a line like this:

hosts: files dns

and add the token "wins" to the end e.g.

hosts: files dns wins

At least, that works on FC3 and slackware 10. I don't know about Redhat
8. In any case, what it should do is add a "wins" resolver to the
resolver list for hostnames, so if the name resolver doesn't find a
network hostname in the hosts file or from DNS it will try WINS next.
You can check the man page for nsswitch.conf for more info.

Hope this helps!


Jim P.
Ottawa
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DDNS Update Over-writes DHCP Registered address? Cliff Windows Networking 0 09-22-2008 10:08 AM
How can I alocate a hostname based on MAC adress and DHCP? Andi Linux Networking 1 10-26-2006 08:23 AM
DHCP: overriding hostname of clients Stefan Bellon Linux Networking 4 10-24-2004 12:41 PM
How to use hostname to connect to a DHCP client machine? Steve Dondley Linux Networking 2 02-04-2004 12:38 AM
Mandrake Assigns Hostname Before DHCP? ignatius@notreal.net Linux Networking 0 09-29-2003 02:38 PM



1 2 3 4 5 6 7 8 9 10 11