Advertising disclosure

Hosting Canada is community-supported. We may earn a commission when you make a purchase through one of our links. Read Disclosure.

How to Add a Host Name “Alias” in the /etc/hosts

You can add the host name and aliases of the storage system in the /etc/hosts file. You can use the setup command to rewrite the /etc/hosts file.

This process was Updated for Data ONTAP 8.1.1 on 14 June 2012, via

How to do this:

During setup, if you enable IPv6 on the storage system and configure IPv6 addresses for your network interfaces, these IPv6 addresses are also added to the /etc/hosts file.

From a workstation that has access to your storage system, edit the /etc/hosts file. Add the following line to the /etc/hosts file:IP_address host_name aliases

IP_address is the IP address of the host.

host_name is the name of the host.

aliases are the alias names for the host.


To add a host name, myhost, with an IP address, add the following line in the /etc/hosts file: myhost newhost myhost-e0a

newhost and myhost-e0a are the alias names for myhost.

The following is a sample /etc/hosts file:

#Auto-generated by setup Tue Apr 21 17:41:40 IST 2009 localhost    	 myhost myhost-e0a
#       myhost-e0b
#       myhost-e0c
#       myhost-e0d

The following is a sample /etc/hosts file in which an IPv6 address is also configured for the interface e0a:

#Auto-generated by setup Tue Apr 21 17:41:40 IST 2009 localhost    	 myhost myhost-e0a
2001:0db8::95   myhost myhost-e0a
#       myhost-e0b
#       myhost-e0c
#       myhost-e0d

Additional aliases via the ‘hosts’ file

Here is another approach for adding aliases via the host file, adapted from Johan Jansson @

If you find yourself writing an internet address often, you can alias it to a simpler name. For example, I telnet quite often to a server at my old university: I have aliased this to “mumrik”, so instead of having to type “telnet”, I can now type “telnet mumrik”. This alias will work with any program using internet addresses, NetPositive too, though it may be easier to make a bookmark there. Here is how you do it:

Edit the file /boot/beos/etc/hosts, create it if it isn’t there already.
Add entries with this format: alias

For example, his mumrik alias looks like this: mumrik



Leave a Reply

Your email address will not be published. Required fields are marked *