[ previous ] [ next ] [ threads ]
 
 From:  Pierre Nast <pierre at coldev dot org>
 To:  m0n0wall dash dev at lists dot m0n0 dot ch
 Subject:  [patch] adding cnames, mx-host and log to dnsmasq
 Date:  Wed, 13 Nov 2013 22:13:21 +0100
Hi,

First, this is my first post to this list and English is not my native 
language, please excuse errors.

I have a small LAN with several servers, workstations and printers. I 
use m0n0wall as my network core (router and firewall). The m0n0wall box 
also provides DHCP and VPN services.
I've got an old machine that provides DNS and I want to get rid of it, 
so I thought of using m0n0wall to provide the DNS service. My previous 
DNS setup involved CNAME and MX records. As m0n0wall did not provide 
such features, I started working on it. I came with the patch in attachment.

This patch provides four features :

1. DNS queries log:
It had be requested once on the user mailing list and I needed it to 
test my changes.
I added a checkbox in the "DNS forwarders" page enabling/disabling 
queries' log.

2. dnsmasq configuration file:
Currently, dnsmasq read its parameters from command line. I wanted to be 
able to check these parameters, so I moved from command line parameters 
to a configuration file. The generated configuration file is written to 
/var/etc/dnsmasq.conf.

3. cnames:
In the "DNS forwarders: Edit host" page, I added a new field named 
"Aliases". Each alias found in this field is then appended to the 
configuration file two times: with and without the domain name recorded 
in the "General setup" page.
A check for overlapping cnames is done upon form's submission, like it 
was done for hostnames overlapping.

4. mx-hosts:
Still in the "DNS forwarders: Edit host" page, I added a new row named 
"Extra options". In this row there's a checkbox, enabling one to using a 
host as the MX for it's domain. When the checkbox is checked, a mx-host 
line is added to the configuration file.

I did not take the dnsmasq's authoritative configuration (see dnsmasq's 
manual) path as I thought it would be overkill. If someone disagree with 
this choice, please let me know; I will then try to work on another 
patch implementing that.

I hope you'll find this useful; I found some threads in the m0n0wall 
forums asking for cnames and mx-hosts features.
If there's anything in this patch that should have been done another 
way, please let me know; I'll rework and repost it.

-- 
Pierre
dnsmasq_cnames_mx.patch (7.0 KB, text/x-patch)