Lets say we have to setup idify.loc on our local linux system

First of all we will setup DNSMasq: a small dns daemon which is really easy to configure. This’ll be used for wildcard subdomain domain names.

sudo apt-get install dnsmasq

After that we have to create a file in the folder /etc/dnsmasq.d/ with the domain name for the subdomain wildcard to work.

In our case the filename is idify

Type the below text in this newfile created

address=/.test.loc/127.0.0.1

and then restart the dnsmasq service

sudo service dnsmasq restart

Now the last thing remaining is the changes in virtual host entry under /etc/apache2/sites-available/

Add below two lines under your virtual host entry

ServerName idify.loc

ServerAlias *.idify.loc

Thats all.

Now you can run any subdomain with idify.loc on browser .

Setup automatic subdomains on your local linux based computer

Leave a Reply

Your email address will not be published.