24

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?

0

3 Answers 3

33

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.

5
  • 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). Aug 19, 2010 at 5:39
  • 7
    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 Nov 30, 2010 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, 2012 at 3:17
  • 2
    can you configure avahi to work with bare hostnames?
    – cmcginty
    Feb 19, 2013 at 1:26
  • @mattwilkie, That still doesn't get it to work for me...
    – Cerin
    Nov 30, 2014 at 1:00
4

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.

4
  • @ELadner: Windows does that by using WINS. For Ubuntu Server it's sufficient to install the Samba client. Sep 9, 2010 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). Sep 16, 2010 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. Sep 16, 2010 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. Sep 16, 2010 at 14:24
3

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.

You must log in to answer this question.

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