Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple local domains with dnsmasq?

So I'm using dnsmasq for my local dev environment & I need to set it up to use multiple domains ex. (.dev, .test, .somethingelse) how can this be done?

currently It's working with .dev only

this is how my dnsmasq.conf looks like

address=/dev/127.0.0.1
listen-address=127.0.0.1
like image 285
John Avatar asked Jul 11 '13 12:07

John


2 Answers

For every (sub)domain you want to server locally, add the following entry to your dnsmasq.conf:

address=/.domain/127.0.0.1

Now let your OS know, that you want to redirect requests to this domain to your local dnsmasq nameserver. Do this by creating a file "domain" in "/etc/resolvers".

/etc/resolvers/domain has the following content:

nameserver 127.0.0.1

More info about the resolver thing.

like image 139
mattes Avatar answered Sep 21 '22 16:09

mattes


for me, address=/.aaa.com/.bbb.com/127.0.0.1 do the trick.

like image 25
Jayy Lucas Avatar answered Sep 22 '22 16:09

Jayy Lucas