Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a mixed network with mostly Windows machines, a Mac, and a few Linux boxes. There is no DNS or WINS server, and adding one is outside of my control. If I put a clean install of 10.04 desktop on a computer, then all other machines on the network can get to that machine by hostname just fine.

However, if I put 10.04 server on the same computer, then the other machines can only get to it by IP address. The hostname does not resolve. What do I need to do on the server so that all the other machines on the network can get to it?

share|improve this question

3 Answers 3

up vote 20 down vote accepted

This has to do with Avahi, a Zeroconf implementation which advertises hostnames on the local network.

You can get started with Avahi on your server by installing the daemon:

sudo apt-get install avahi-daemon

From that point, you should be ready to go. Check out the docs in /usr/share/doc/avahi-daemon/ if you have additional trouble.

share|improve this answer
    
Hooray! Thanks! –  Warren Pena Aug 19 '10 at 5:34
    
Just to add a little more info, this fixed the reverse direction too (the server accessing other machines by hostname, which was also not working before). –  Warren Pena Aug 19 '10 at 5:39
6  
At first I thought this wasn't working for my network, but learned you need to append .local to the hostname, e.g. ping basement-server.local –  matt wilkie Nov 30 '10 at 11:44
    
Followed the directions directly and got lost a bit trying to find, open, and understand the documentation because I figured I had to do some configuration. I then realized that it was already working ;) I guess they don't call it zeroconf for nothing. –  jpierson Feb 22 '12 at 3:17
2  
can you configure avahi to work with bare hostnames? –  Casey Feb 19 '13 at 1:26

You have to have a DNS (Domain Name System) server somewhere to handle that name resolution. Some routers have a DNS server coupled with their DHCP server. Check your router and see if it has one and it's disabled. Ubuntu automatically sends the configured host name out to the DHCP server when it requests an IP address, and if the router has an enabled DNS server, it should report that name/IP to the DNS server, also.

Short of that, you can put the name and IP address of your Ubuntu box in the hosts file on the windows machine in c:\WINDOWS\system32\drivers\etc\hosts. Provided your Ubuntu machine's IP address doesn't change (or change often), that might be a simple, long term solution.

share|improve this answer
    
@ELadner: Windows does that by using WINS. For Ubuntu Server it's sufficient to install the Samba client. –  Radu Sep 9 '10 at 8:03
    
If you're only looking to direct one computer to the *nix machine using name resolution (or you're willing to modify the hosts file on all the machines that will) then just change the hosts file on the windows machine. The hosts file is basically a short-circuit redirect for convenient local namespace resolution (and for spyware to plant rogue redirects and screw up your internet experience). –  Evan Plaice Sep 16 '10 at 14:07
    
It's probably important to note that WINS isn't really a proper DNS server because it supports its own MS proprietary name resolution protocol. So, if for some reason you connect a *nix or mac box to the network that needs to talk to the *nix server, you can't do it with a WINS server. IE, WINS only plays nice with Windows. If you look up the history, WINS only exists today to provide legacy support for pre-windows 2000 operating system name resolution. See en.wikipedia.org/wiki/Windows_Internet_Name_Service for more info. –  Evan Plaice Sep 16 '10 at 14:13
1  
If the router doesn't have dns support built in, and you're looking for a full blown DNS server implementation install bind (a dns server) on the *nix box, configure in the dns redirect, and forward dns port requests from the router to the *nix computer. For a detailed explanation of how this is done (and dns in general) see zytrax.com/books/dns. –  Evan Plaice Sep 16 '10 at 14:24

You configure nmbd with a netbios name and then you can use that netbios name on the local network without knowing the IP address.

One time, whilst talking to a Windows SysAdmin that I know, I was surprised to be told that when you plug a Windows PC into the network, even if you don't know the new IP of that machine, you can still find it on the network by using it's Windows name.

I thought that this was some kind of crazy magic but it turns out you can achieve the same thing on Linux by installing, configuring and running nmbd. This is part of Samba.

To find out more, check out this link.

It sounds that this is what you are asking about.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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