1

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.

4

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:

http://en.wikipedia.org/wiki/List_of_wireless_router_firmware_projects

Thanks to leif81 for mentioning this first.

3
  • 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
  • 1
    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
3

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

2

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.

1

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.

0

When I was trying to find resolution to exact same problem what @grigy, I stumbled on this thread. I am sure his problem is resolved by now but I wanted to share my experience just in case it helps someone else.

Routers available these days have options to reserve IP address for a device. the location of this functionality may vary from router-to-router, but in my router (SBG6580) it available under DHCP submenu. The section heading "Reserve IP Address" where it allows you to reserve up to 16 IP addresses. I assigned IP address of my choice to my Linux box and the in other computer I updated hosts file with name and IP address, now I can access my Linux box by name.

Hope this helps..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.