Understanding Linux hostname resolution
On a network, it's much more convenient to look up other resources by name, rather than remembering the IP address of every resource we connect to. By default, looking up hosts by name may not function without a little configuration. For example, you can try the ping
command against the name of one of your Linux machines, and you may or may not get a response. This is because a DNS entry for the resource you're connecting to might not exist. If it doesn't, you'll see an error similar to the following:
ping: unknown host potato
However, if you ping the device by its IP, it would more than likely respond:
64 bytes from 10.10.96.10: icmp_seq=2 ttl=64 time=0.356 ms
Note
Press Ctrl + C on your keyboard to break out of your ping
command, as it will ping forever if it finds a connection.
The reason for this is in order for a network host to be able to contact another, it needs to know its IP address. If you type in a name instead of an IP...