Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2481  / 12 Months ago, wed, may 31, 2023, 5:42:42

I have a domain test.dev bound to 127.0.0.1 in /etc/hosts. How can I bind all the subdomains, e.g. any.th.ing.test.dev to 127.0.0.1 as well?


More From » 11.10

 Answers
5

This is actually dead-simple with dnsmasq:



# install dnsmasq
sudo apt-get install dnsmasq
# map anything ending in .dev to 127.0.0.1
echo address=/dev/127.0.0.1 | sudo tee /etc/dnsmasq.d/dev
# restart to make it read new config
sudo service dnsmasq restart
# verify it's working
host gsdf.gsd.fg.sdf.g.dev
# gsdf.gsd.fg.sdf.g.dev has address 127.0.0.1

[#41011] Thursday, June 1, 2023, 12 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
measord

Total Points: 259
Total Questions: 131
Total Answers: 106

Location: Venezuela
Member since Sun, Oct 2, 2022
2 Years ago
;