[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: hostname doesn't stick



From: "Mikkel L. Ellertson" <mikkel infinity-ltd com>

Tim wrote:
On Sun, 2006-09-17 at 10:32 +0100, Anne Wilson wrote:
Do you mean adding a line for the local host addresses to the hosts
file?  If you have any service, including the X server, sendmail, etc.,
that tries to start up using the machine's hostname, it has to be able
to know what IP and name are associated with each other.

This is especially true if you are not connected to a network. And
it has to be an IP address that the machine responds to. So you can
not give it an IP address like 127.0.0.2 unless you create a second
interface like lo:1 that responds to that IP address.

[root thing ~]# ssh 127.1.1.1
root 127 1 1 1's password:
Last login: Sun Sep 17 14:43:14 2006 from 127.1.1.1
[root thing ~]#

No further comment needed. But I will anyway. The hosts file is for
name lookup. It does not assign addresses or enable addresses.

One of problems is home networks connected to a firewall/router
using DHCP. A lot of them handle DHCP, and act as a caching name
server for the local network, but they do not DHCP lease to hostname
mapping. So you can not ask the name server for the IP address for
your hostname. Now, if you can configure the DHCP server so that you
always get the same hostname, you can put that entry in your
/etc/hosts file and be all set.

A better solution might be to add an option to the DHCP client so
that it can add/remove a /etc/hosts entry for your hostname that
matches the IP address assigned to the interface. You would need to
be able to control it on an individual interface option. (I have not
looked into this - do any of the DHCP clients support this?)

I'm not sure about dhcp clients; but I do know that the Microsoft
DHCP defaults attempt to register the changes with the DNS servers.
I have that blocked for security reasons. And I have fixed address
DHCP assignments instead.

{^_^}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]