Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I have set up Samba on Ubuntu Server. Everything works fine, but I can access the dir only by providing ip address: smb:// but not the host name smb://myhost/public.

user@host$: cat /etc/hostname

What do I need to set up to see this from other machines without providing IP?

share|improve this question
up vote 2 down vote accepted

If you're using static IP in your LAN, you can add the following to your /etc/hosts file
share|improve this answer

Just guessing you have no DNS server in your network. In that case the easiest method is to add a line in the hosts file on your client: myhost

On Linux this file is in /etc/hosts, on Windows it resides in C:\windows\system32\drivers\etc\hosts

Don't remove existing lines from the file, just add this line.

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.