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 media/file server running Ubuntu 10.10 Maverick Meerkat, connected via cable directly to a DSL router, which also acts as a network switch.

The router uses DHCP to dynamically assign IP addresses. I'd like to keep it as such, if possible. I have friends come in and it's easier for them to connect.

From my desktop (Ubuntu 10.04 Lucid Lynx) I connect via wireless to the router. I can ping the media server and ssh into it using it's IP, but it fails when I use the hostname.

When I ping and ssh wirelessly from my Netbook (Crunchbang Linux), it strangely enough works using the media server's hostname.

That said, I believe it may not be a router configuration issue, but something on my desktop I have to configure.

I tried turning off the firewall, on both sides (sudo ufw enable/disable).

What else can I check or try? Thanks :-)

share|improve this question
2  
Try ssh user@HOSTNAME.local or ping HOSTNAME.local. –  Dayjay Jan 24 '11 at 10:09
    
the hostname does end with .local, as I can ping it from the netbook as HOSTNAME.local –  invert Jan 25 '11 at 5:22
add comment

3 Answers 3

up vote 6 down vote accepted

Try sudo apt-get install winbind

You probably want to add 'wins' where it says "hosts:" in /etc/nsswitch.conf

share|improve this answer
    
I added 'wins' to nsswitch.conf, the change has not picked up yet but I will retry again tonight! –  invert Jan 25 '11 at 5:33
1  
It turns out 'wins' needs to be placed before dns in nsswitch.conf. It then worked, but only for a while, after I reconfigure the network for port forwarding :/ So even though I am going the static IP router later, you were correct suggesting to add 'wins' into nsswitch.conf :) –  invert Feb 7 '11 at 6:56
add comment

Using hostnames requires the name service resolution to be properly setup, since you are using DHCP that should be automatically managed by your router. Check /etc/resolv.conf (it contains the DNS configuration).

share|improve this answer
    
resolv.conf points to the router –  invert Jan 25 '11 at 7:24
add comment

If you can set up the machines to receive the same IP address every time, for example by using the MAC address in the router, or if you can set up static addressing on each machine, then you can create a hosts file that will enable the functionality.

# sample /etc/hosts
#
127.0.0.1   localhost.localdomain   localhost
::1     localhost6.localdomain6 localhost6

192.168.1.1 router.example.com  router
192.168.1.201   machine1.example.com    machine1
192.168.1.202   machine2.example.com    machine2
192.168.1.203   machine3.example.com    machine3
share|improve this answer
    
How does his affect when other people want to use the wireless network? Would I need to configure their machines too? Some might be once-off connects, others not. –  invert Jan 25 '11 at 5:26
    
Yes - you would. Can you post your /etc/samaba/smb.conf and /etc/nsswitch.conf? –  user8290 Jan 25 '11 at 14:50
    
I think I will setup static IP's when I get some time, if it means I can use machine names properly. Thanks! –  invert Feb 7 '11 at 6:54
add comment

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.