Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a local home network. The computers get IP address from a router via DHCP. So the address are dynamic and change. How can I assign names to computers to be able refer by name?

One computer is WinXP, the other is Linux running on VMWare. I need to access the Linux by name.

share|improve this question
up vote 4 down vote accepted

If all of your computers are running Windows Vista or higher, you should be able to refer to them by name already. If you aren't sure about the names just click Start->Network in Vista/Win7.

If you have a mixture of operating systems, you will need to either edit the local hosts files on each machine (\windows\system32\drivers\etc\hosts for windows machines, /etc/hosts for others), OR setup a DNS server on your network and set your local DNS server as the default DNS in your router. And old computer (even REALLY old like a pentium 60) running linux can do this very nicely. There are also DNS servers for windows, but I am not personally familiar with any of them.

EDIT: For completeness, you should also consider installing an alternate OS on your router if it supports it. I'm running Tomato but DD-WRT is probably the most popular. See this Wikipedia page for more info:

Thanks to leif81 for mentioning this first.

share|improve this answer
If you have just a few machines around the house, editing the hosts file on all the machines will probably be the easiest solution. – Russ Warren Dec 10 '09 at 22:27
But how I'm supposed to se up the hosts file if the IPs are dynamic? – grigy Dec 11 '09 at 8:39
I apologize, I mis-read the original question. Host files aren't going to work of your IPs change. However, I would check if they are really changing. With my own consumer routers (linksys & SMC) I have noticed that the machines keep their IPs unless they are turned off for a long period of time. My own solutions to this in the past were to flash a custom router like leif81, or run a local DNS server. – Mark Porter Dec 11 '09 at 18:05

If you are running Windows on the machines, you can use NetBIOS.

share|improve this answer

Your home router may be able to support third party firmware like tomato or dd wrt. Both of which allow you to create static DHCP entries for hosts in your home network based on their MAC address.

share|improve this answer

Depending on you needs and your access to the DHCP settings, your options are:

  • dynamic dns daemon
  • samba with wins
  • hosts files

If you have access to the DHCP server you can preseed the dns server with your internal dymanic dns server, and have that server forward external domain requests on to your ISP's dns. It is easier to implement this solution if you are running your own DHCP daemon (not on the router).

If you don't have access to the DHCP server you can setup samba on a linux server with WINS and use it for name resolution with all the windows or samba clients on the network.

The hosts file is easy to manage if you have a handful of servers, but you'd need to write some scripts (one for each platform) if you wanted this to be automated. Automation with host files accross platforms would get ugly real fast.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .