Joined: 30 Jul 2007 Posts: 33 Location: Melbourne, Australia
Posted: Fri May 07, 2021 8:23 Post subject: dnsmasq - catch all (default) Mail eXchanger (MX) record
Hi,
I know there are MX related configuration options which can be used in dnsmasq.conf (mx-host, mx-target, selfmx and localmx) - however, none of them appear to be able to deliver the functionality I'm looking for - in any combination.
I have an internal network that is using dnsmasq for name resolution and some (not all) hosts are using it for DHCP.
I would like dnsmasq to deliver a single MX record back to all hosts on my internal network no matter what mail domain is being used in the MX query - i.e. a default MX (which I'll point to my SMTP smarthost).
The description of the 'mx-host' option in dnsmasq's man page makes reference to this type of requirement ("for directing mail from systems on a LAN to a central server") - however, dnsmasq still appears to expect to be configured to provide responses only for specifically requested mail domains ("mx name").
Essentially, I believe I want to specify a wildcard (or default) as the "mx name" (or "mail domain").
Has anyone managed to achieve this?
Thanks.
[Edit: dnsmasq uses "mx name" as the target mail domain - I got the fields mixed up in my original post] _________________ Asus RT-AC87U - dd-wrt
Asus RT-AC68U - dd-wrt
Asus RT-N16 - dd-wrt
TP-Link TL-MR3020 - OpenWRT
VAPs / VLANs / PBR / Entware
Last edited by msj100 on Sun May 09, 2021 3:22; edited 1 time in total
Joined: 30 Jul 2007 Posts: 33 Location: Melbourne, Australia
Posted: Fri May 07, 2021 23:20 Post subject:
Wildlion wrote:
I am not sure how this is dd-wrt related beyond the fact that dd-wrt has dnsmasq on it.
It might be stripped out of dnsmasq on the build, but I do not know. You ought to head over the dnsmasq email lists.
I do not feel like spending the time to figure it out.
I came to the same conclusion and did pose my question on the dnsmasq email list - it doesn't look like this is possible right now. Best suggestion was to use DNAT to redirect SMTP traffic to the smarthost.
I asked here merely to see if someone had already done it before given the embedded dnsmasq is used quite often and in interesting ways on dd-wrt - however, I appreciate that dnsmasq != dd-wrt.
Thanks for your feedback. _________________ Asus RT-AC87U - dd-wrt
Asus RT-AC68U - dd-wrt
Asus RT-N16 - dd-wrt
TP-Link TL-MR3020 - OpenWRT
VAPs / VLANs / PBR / Entware
Joined: 30 Jul 2007 Posts: 33 Location: Melbourne, Australia
Posted: Sun May 09, 2021 3:34 Post subject:
Wildlion wrote:
No worries, and I could have worded the previous post better, I was more cranky yesterday than I thought... (was a long week), so sorry.
That is an interesting problem, my only other thought might be run a different dns server on another machine such as unbound or BIND
No worries - I have days like that too !
Agree - it might be possible to use another DNS server - although it could be a bit tricky to forward by query type (MX).
Looking at the source for dnsmasq, rfc1035.c appears to include code to check for a subdomain in check_for_local_domain() - I was hoping something like a single '.' in "mx name" for the mx-host option might match - but doesn't look like that's the case (I'm obviously looking at the wrong bit of code).
For now, DNAT of SMTP at the internal perimeter will do the job.
Thanks. _________________ Asus RT-AC87U - dd-wrt
Asus RT-AC68U - dd-wrt
Asus RT-N16 - dd-wrt
TP-Link TL-MR3020 - OpenWRT
VAPs / VLANs / PBR / Entware