6

I have a LAN at home with my desktop and my laptop. IP addresses are allocated dynamically to both, so the IP number keep changing.

I try to connect from one to the other using places->Server, and in there if I put the correct IP address I connect without any issues. But if I put the hostname, it doesn't recognize. Same thing if I try to ping the hostname v/s the IP address.

The funny thing is that I can see the hostnames if I go to places->network. So basically ubuntu has got a way of telling what are the machines connected to the network and what are their names, I wonder how can I exploit this to keep an up-to-date routing table that map the hostname to the correct IP address.

PS, both desktop and laptop are running Ubuntu. I'm using version 10.04 and 10.10

Thanks

Charbel
  • 247

2 Answers2

7

Ubuntu comes with the Avahi implementation of mDNS service discovery (also known under Apple's trademarked name Bonjour), which advertises your hostname over the local network under the .local domain. The standard hostname resolver will also do mDNS lookups.

So if you set the hostname of one of your computers to foo, you should be able to ping it from another machine on the local network with:

ping foo.local

You should be able to use these .local names with most software on Ubuntu.

0

Depending on your LAN setup, many routers have the ability to rember and reserve ip addresses for specific machines, this would keep their names and ips the same.

Alternatively you could set up static ip's for each machine. The network manager tool can do this,

I tend to go both routes, my router gives dynamic ip's in the 192.168.1.200+ range and i set up static ips on most of my machines in the 192.168.1.100-199 range.

dr_willis
  • 492