Ubuntu point all .test domains to 127.0.0.1

Until recently .dev was popular TLD used by developers for local web development. Recently google acquired the rights to use .DEV domain name extension and forced SSL for this LTD in google chrome.

Web developers are looking for alternate home for their local development web sites. Some suggested .localhost as development LTD, but it is too large. Another option is .test, this is a reserved LTD, so you won’t be forced to leave and is short. So many opted for .test as local development domain extension.

DNSMasq allow you to point *.test domains to 127.0.01, so you don’t have to edit /etc/hosts and add each domain you need for local development.

Advertisement

To do this, create file

vi /etc/NetworkManager/dnsmasq.d/test

Add following

address=/.test/127.0.0.1

Restart network-manager.

service network-manager restart

We restarted network-manager as dnsmasq is started by Network Manager.

root@hon-pc-01:~# pstree -sp $(pidof dnsmasq)
systemd(1)───NetworkManager(11557)───dnsmasq(11594)
root@hon-pc-01:~#

dnsmasq

Add a comment

Leave a Reply

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

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement