Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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