[nzlug] assign host name to computer
Daniel Pittman
daniel at rimspace.net
Mon Mar 5 13:01:15 NZDT 2007
"anru chen" <ctx2002 at gmail.com> writes:
> we have a small network, all computers are connected to a route, each
> time when a computer be booted up , the router will assigh a new ip to
> the computer.
Via DHCP, I presume, with the router acting as the DHCP server.
> my question is how can i assign a fixed name to a computer that got
> different IP at each time?
Well, let me answer the question I /think/ you are asking rather than
the one you wrote first:
The way you would normally do that is to assign a fixed *IP* to a
computer, then assign the name to that. That way your name will always
point at that machine.
The way to assign a fixed IP is in the DHCP settings for the router:
somewhere in there they usually hide a page where you can assign a fixed
IP address to the MAC (or Ethernet) address of your computer.
That also has the advantage that, for example, a port forwarding you
configure on the router will also point to the right computer at all
times.
Anyway, if you /don't/ want to use a fixed IP -- which does make things
easier -- you need to configure "Dynamic DNS" for the machine you want a
consistent name for.
You are probably already familiar with services like 'dyndns.org' who
offer this on the Internet. Both the Microsoft and Linux (Bind, and
others) DNS servers *also* offer this "dynamic update" process.
So, what you can configure is that when your computer is assigned an
address via DHCP it contacts the DNS server and updates the record there
to point to that new IP address.
Under Windows this is the "register connection with DNS" option, or
something similar, found in the properties pages for the network
interface.
Under Linux you need to hook the 'nsupdate' tool into your DHCP client;
that is easy enough to do on most distributions, but it isn't an "out of
the box" option anywhere that I know of, sadly.
Anyway, that resolves the client side. On the server side you need to
allow dynamic updates -- which is documented in the DNS software manual
for all the examples I know, under "dynamic updates" or "dynamic DNS" --
and ensure that the appropriate security, etc, mechanisms are in place.
In the unlikely event that you really do want dynamic IP and fixed
hostname in DNS rather than simply assigning a fixed IP then feel free
to ask once you hit trouble with the dynamic DNS stuff.
I strongly urge you to consider the former, though. I have configured
dynamic DNS and, believe me, it isn't nearly as much fun as you might
hope. ;)
Anyway, in case your question was really "my ISP assigns a dynamic
address to my modem" rather than one internal to the network: check out
dyndns.org and similar services. :)
Oh, and finally: some router devices have an option to publish the DHCP
client "hostname" value into an internal DNS cache. You might check the
documentation to see if that is available -- which, on a consumer grade
device it probably isn't.
If yours does then you could have the dynamic IP, fixed name, part more
easily. I wouldn't hold my breath though.
Regards,
Daniel
--
Digital Infrastructure Solutions -- making IT simple, stable and secure
Phone: 0401 155 707 email: contact at digital-infrastructure.com.au
http://digital-infrastructure.com.au/
More information about the NZLUG
mailing list