-3

I've got an Ubuntu Server on my LAN. I can fully use it (samba, ssh, apache2, xmpp...) by using it's ip address. But I want to use the hostname to connect (e.g. ssh). When I do a nslookup with the ip address of the server, the answer is: name = noname (which is NOT the server's hostname ;-) Other hosts on the LAN are responding with the correct hostname.

Output of nslookup 10.0.0.24 (this is my ubuntu server): shows no hostname

Server:     127.0.1.1
Address:    127.0.1.1#53
24.0.0.10.in-addr.arpa  name = noname.

Output of nslookup 10.0.0.21 (this is my raspberryPi): shows the right hostname.

Server:     127.0.1.1
Address:    127.0.1.1#53
21.0.0.10.in-addr.arpa  name = retropie.

All hosts get their ip address over DHCP. So the hosts, who show their hostname correctly were never configured separately.

9
  • What is your DNS server and do you have admin rights to it? May 13, 2016 at 17:35
  • Are you registered in the local server's DNS?
    – Bert
    May 13, 2016 at 17:37
  • Of course I have admin rights to my server :) I didn't set up an extra DNS Server. On my LAN there is only a router with connection to my ISP and a few other hosts. Those other hosts are a RaspberryPi and a Windows machine. Both show up the right hostnames when doing nslookup.
    – bastele
    May 13, 2016 at 17:39
  • @Bert What do you mean with registering to my server's DNS ?
    – bastele
    May 13, 2016 at 17:42
  • 1
    @RedCricket on Ubuntu dig is included out of the box :)
    – grooveplex
    May 13, 2016 at 18:04

2 Answers 2

1

For such a small network and without the assumption that there is dns server on this network you can simply add the ip addresses to the local hosts file on each machine. I know this is a bit "old school" but it will be 100% solid and never fail.

The reason dns may failing is that your dhcp server may be providing dns settings for a dns server that either you do not control or one that does not get automatic updates from the dhcp system. If you add a static entry into your (dns server you control whose ip address is given out via dhcp) then you will get the correct nslookup from a cli from any machine on your network.

1
  • yes, it seems that ubuntu doesn't provide the hostname over DHCP by default. But because the rasberryPi does it, i search for a solution to also provide the hostname automatically for the DHCP-Server (router)
    – bastele
    May 14, 2016 at 7:07
0

There's no automatic system for making your hostname known to the rest of the network. If you have a DHCP server (often on your router in home setups) that might know it (I can see that mine does, but I don't know the DHCP protocol well enough to know how it's done). If you want others to know what IP address a certain name corresponds to, you (typically) have to set up DNS.

1
  • I edited my Question: The router gets the corresponding hostnames automatically for all my hosts but my ubuntu machine(s)
    – bastele
    May 13, 2016 at 17:59

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