Use /etc/hosts to direct wildcard domain name

You need to set up a DNS server. (install dnsmasq (is light) or bind (is rather heavy)). To install ...

 sudo apt-get install dnsmasq

In /etc/NetworkManager/dnsmasq.d/dnsmasq-localhost.conf

add

 address=/localhost.com/127.0.0.1

restart

 sudo /etc/init.d/dnsmasq restart

Important note.

If dnsmasq service failed to start, please check your service logs by running systemctl status dnsmasq.service command.

Then, If you will see the following message in the logs Failed to create listening socket for port 53: Address already in use - you may resolve this error as described here

Tags:

Dns

Hosts

Server