I would like to use an alias for a remote host. For example, when instead of "ping giraffe.foo.bar.com" I want to do "ping giraffe", but only when I do it from my own machine. I am able to do this for raw IP addresses by adding an entry in /etc/hosts (ie "123.456.1.0 giraffe"), but it does not seem to work for host names.
Asked
Active
Viewed 210 times
2 Answers
1
You can add foo.bar.com to the DNS suffix list. You have to do this to each client individually. HOWEVER, you can also set your DHCP server to add entries to the DNS suffix list, which is a way of doing individual client updates in a centralized fashion.

mfinni
- 36,144
- 4
- 53
- 86
0
If your hosts file is not working it may be because your /etc/nsswitch.conf file has dns listed before hosts

djdicbob
- 31
- 2