We have a server on the company network named serverA, and if I type ssh serverA
, it will connect my PC to this server, even though there is no entry for this server in my /etc/hosts
, but I used to have another PC where I do have to set this up manually in /etc/hosts
. So, how does ssh discover hostnames on the network, and how can I make sure it works? (Both these machines I mentioned are running Kubuntu Linux, the older one runs 12.10, the newer one runs 13.04.)
I have the following content in /etc/resolv.conf
:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search mycompany.com
Processes listening on port 53:
sudo ss -ulnp | grep 53
#UNCONN 0 0 *:5353 *:* users:(("avahi-daemon",937,12))
#UNCONN 0 0 127.0.1.1:53 *:* users:(("dnsmasq",1781,4))
#UNCONN 0 0 :::5353 :::* users:(("avahi-daemon",937,13))
nameserver 127.0.1.1
which tells the resolver to try to translate hostnames to IP addresses. The IP of the nameserver starts with 127, and 127/8 points back to your own host. So you probably are running a nameserver on your own computer.sudo ss -ulnp | grep 53