Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

On my work's network, my new debian headless VM is not visible via its hostname.

I'm using:

Debian Jessie


bridged adapter

I can see other VMs on my machine from the headless VM, and I can see other machines on the network from the headless VM (that is, ping machine works for both cases). I can also ping the host machine.

I tried installing acahi-daemon and avahi-discover, as per this thread with no success. Additionally, I edited dhclient.conf to have the line send host-name "Peridot"; (Peridot being the VM's hostname).

Specifically, I'm hosting an instance of haste-server on the machine, which I can access via browser by the machine's IP but not by it's hostname (which is what I'd like). I cannot ping it from any other machine on the network by name, but it can be reached via its IP.

Any help appreciated

share|improve this question
What OS are the other VMs and machines running? – garethTheRed Aug 13 '14 at 13:55
They're all windows machines – Mitch Aug 13 '14 at 13:55
up vote 3 down vote accepted

Your Windows machines can use NetBIOS Name Resolution to tell each other about themselves. This is Microsoft specific protocol and doesn't work with Linux/Unix machines, which use a static file (/etc/hosts) or the Domain Name Service (DNS) for name resolution.

Your Windows machines will not recognise the AVAHI service without installing one on each machine (I believe Apple provide one).

You have a few options:

  1. Edit the hosts file mentioned above on all computers (it's in C:\Windows\System32\drivers\etc on Windows and in /etc/ on Linux). As a minimum, you'll have to add all Linux machines/VMs to it.
  2. Run a DNS server on one of your machines.
  3. Install samba on your Debian VM. This is a service that allows a Linux machine to share it's files with Windows client. It also happens to announce the host using the NetBIOS Name Resolution service so your Windows machines will be able to see the Linux VM by name. As @JoelDavies comments, this will be one way only. It won't allow the Debian VM to access all other Windows machines by name, but will allow all Windows machines to access the Debian by name.
share|improve this answer
It's worth noting that option #3 still won't allow name resolution from the VM to the Windows machines, just the other way around. – Bratchley Aug 13 '14 at 14:08
Thanks @JoelDavis - I've edited it. – garethTheRed Aug 13 '14 at 14:16
Debian can already ping the other machines by name - or by "won't allow the Debian VM access" you mean the it won't allow access to the files? – Mitch Aug 13 '14 at 14:18
I did mean "access by name" as opposed to having to use Debian's IP address. You say that Debian can already ping others by name. Are you already running a DNS server on your network? Are all systems using DHCP to get their IP addresses? – garethTheRed Aug 13 '14 at 14:23
It's my work network, so I assume we have a DNS server/resolution, I'm not privvy to the details. I'm fairly certain it's a windows network, and when I set up a different windows VM I didn't have to do anything at all for it to be accessible via its name. For example, I have two machines I was testing with: topaz another VM on my machine and Mars another VM on a different machine. From Debian and windows I can ping both of them by name. From windows, I can access webapps hosted on those by going to topaz:8080/webapp. I was able to ping them before installing avahi – Mitch Aug 13 '14 at 14:25

I don't think Windows machines can discover hostnames of other machines magically. Usually looking up by hostnames need a local DNS server. But in your Debian case, you install network auto discovery tool Avahi and you are able to discover other hostnames on the network and able to ping them using hostnames. If you are just looking for a quick solution, just put in the ip and host mapping inside hosts file on Windows machine.

share|improve this answer

Your Answer


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.