Using names, not IP addresses, in home network

Bruce Marshall bmarsh at bmarsh.com
Sun Apr 12 18:13:53 UTC 2009


On Sunday 12 April 2009, Donn wrote:
> On Sunday, 12 April 2009 19:46:10 Dotan Cohen wrote:
> > I have a few computers on a home network, and currently the router
> > assigns them IP addresses with DHCP. However, I find that every few
> > weeks the addresses change. How can I name the machines names such as
> > "laptop" and "ety" instead of useing IP addresses? Everything that
> > I've googled seems quite out of date. Thanks.
>
> Add the name to /etc/hostname ? It may work.

Not really.....  because it still needs an IP address.

The way I do it is to give each computer a static IP address...  and enter the 
name and IP address into  /etc/hosts    Then pass the /etc/hosts file around 
to the various computers.  This only needs to be done once.

And another method would be to have your router hand out specific IP addresses 
based on the MAC address of each computer.   And then use /etc/hosts to point 
to the specific IP addresses by name.

You can also provide your own DNS server but /etc/hosts is much easier. 




More information about the kubuntu-users mailing list