DEV Community

Narenthera Prasanth M
Narenthera Prasanth M

Posted on

Create custom alias for 127.0.0.1 in Ubuntu

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

Step 1

In hosts file, you can see the localhost configured as alias for 127.0.0.1

Step 1.1

Step 2 :

Add your alias like below and save it.

Step 2

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)