Setting up dnsmasq for a local network

Posted by WishCow on Super User See other posts from Super User or by WishCow
Published on 2010-04-27T15:48:11Z Indexed on 2010/04/27 15:53 UTC
Read the original article Hit count: 544

Filed under:
|

Me, and a small group of developers have just moved to a new office, and I'd like to set up dnsmasq on our development server, so when we deploy web apps there, we don't have to edit our own hosts files. We have a router at 192.168.3.1 which we don't have access to. I figured I'd install a DNS server on the development box, and we all record it's IP as a secondary DNS server. Unfortunately I'm strugling to make this work.

The name of the devel server is devbox, it's IP is 192.168.3.99, and it's running the latest Ubuntu Server (Karmic)

My computer is running Ubuntu Desktop (Karmic)

What I'd like to achieve

Let's say I have three websites, website1, website2, website3, running on the development box. I'd like to access them by the urls:

http://website1.devbox
http://website2.devbox
http://website3.devbox

So I have configured Apache on the devel box, installed dnsmasq, and put the following lines into it's hosts file:

192.168.3.99 website1.devbox
192.168.3.99 website2.devbox
192.168.3.99 website3.devbox

and edited my own resolv.conf file to include the devel box as a nameserver:

nameserver 192.168.3.99 

It's working fine, I can access the sites. The problem is that it doesn't scale well. I'd like all the domains ending with .devbox forwarded to the development box, and this is what I'm struggling with.

I have tried putting

192.168.3.99 devbox

into the hosts file, and editing the line in dnsmasq.conf:

# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.
local=/devbox/

But I cannot get it working. If I try any url that is not explicitly present in the development box's hosts file, the dns lookup fails.

Is the local directive for something else? Am I looking at the wrong place?

© Super User or respective owner

Setting up dnsmasq for a local network

Posted by WishCow on Server Fault See other posts from Server Fault or by WishCow
Published on 2010-04-27T15:48:11Z Indexed on 2010/04/27 17:13 UTC
Read the original article Hit count: 544

Filed under:
|

Me, and a small group of developers have just moved to a new office, and I'd like to set up dnsmasq on our development server, so when we deploy web apps there, we don't have to edit our own hosts files. We have a router at 192.168.3.1 which we don't have access to. I figured I'd install a DNS server on the development box, and we all record it's IP as a secondary DNS server. Unfortunately I'm strugling to make this work.

The name of the devel server is devbox, it's IP is 192.168.3.99, and it's running the latest Ubuntu Server (Karmic)

My computer is running Ubuntu Desktop (Karmic)

What I'd like to achieve

Let's say I have three websites, website1, website2, website3, running on the development box. I'd like to access them by the urls:

http://website1.devbox
http://website2.devbox
http://website3.devbox

So I have configured Apache on the devel box, installed dnsmasq, and put the following lines into it's hosts file:

192.168.3.99 website1.devbox
192.168.3.99 website2.devbox
192.168.3.99 website3.devbox

and edited my own resolv.conf file to include the devel box as a nameserver:

nameserver 192.168.3.99 

It's working fine, I can access the sites. The problem is that it doesn't scale well. I'd like all the domains ending with .devbox forwarded to the development box, and this is what I'm struggling with.

I have tried putting

192.168.3.99 devbox

into the hosts file, and editing the line in dnsmasq.conf:

# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.
local=/devbox/

But I cannot get it working. If I try any url that is not explicitly present in the development box's hosts file, the dns lookup fails.

Is the local directive for something else? Am I looking at the wrong place?

© Server Fault or respective owner

Related posts about dns

Related posts about dnsmasq