Is it possible to alias a hostname in linux?

Posted by user10178 on Server Fault See other posts from Server Fault or by user10178
Published on 2009-09-14T15:56:09Z Indexed on 2012/11/16 23:03 UTC
Read the original article Hit count: 126

Filed under:
|
|

I am looking for the right answer to the above question.

It has been asked by jmillikin at ubuntu forums as follows:


Is it possible to create a hostname alias? Sort of like /etc/hosts, but with other hostnames rather than IP addresses. So that with some file like this, you could ping "fakehost1", and it would be re-mapped to "realhost", and then "realhost" would be resolved to an IP address.

# Real host        # Aliases
realhost           fakehost1 fakehost2 fakehost3


Somebody has answered about ssh. But not about ping, etc. My main purpose is to use it as an alias for svn server. In my case, realhost is under dynamic ip. So, "/etc/hosts" alias doesn't work. I want to access my svn server as svn://my_svnserver/my_repos instead of svn://realhost/my_repos.

Thanks in advance for any advice.

© Server Fault or respective owner

Related posts about linux

Related posts about hostname