0

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.

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.

| improve this answer | |
0

If your hosts file is not working it may be because your /etc/nsswitch.conf file has dns listed before hosts

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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