In some cases developers need some alternates for localhost to access the IP 127.0.0.1 in our system.
Here we are going to see how to setup alias for IP 127.0.0.1 in Ubuntu.
Step 1 :
We need to edit /etc/hosts file to add new aliases
In hosts file, you can see the localhost configured as alias for 127.0.0.1
Step 2 :
Add your alias like below and save it.
Now localhost, abc.fake.com and xyz.test.com are aliases for IP 127.0.0.1
Note : Browser always search in your local domain registry before reached to DNS server.
Top comments (0)