dnsmasq - catch all (default) Mail eXchanger (MX) record

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
msj100
DD-WRT Novice


Joined: 30 Jul 2007
Posts: 33
Location: Melbourne, Australia

PostPosted: Fri May 07, 2021 8:23    Post subject: dnsmasq - catch all (default) Mail eXchanger (MX) record Reply with quote
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
Sponsor
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1407

PostPosted: Fri May 07, 2021 22:57    Post subject: Reply with quote
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.
msj100
DD-WRT Novice


Joined: 30 Jul 2007
Posts: 33
Location: Melbourne, Australia

PostPosted: Fri May 07, 2021 23:20    Post subject: Reply with quote
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
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1407

PostPosted: Sat May 08, 2021 21:23    Post subject: Reply with quote
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
msj100
DD-WRT Novice


Joined: 30 Jul 2007
Posts: 33
Location: Melbourne, Australia

PostPosted: Sun May 09, 2021 3:34    Post subject: Reply with quote
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 ! Smile

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
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum