OPNsense Forum

English Forums => 25.7, 25.10 Series => Topic started by: Jyling on November 02, 2025, 10:50:28 PM

Title: MX record in Dnsmasq
Post by: Jyling on November 02, 2025, 10:50:28 PM
There was a thread about it https://forum.opnsense.org/index.php?topic=33962.0 but it does not contain answers.
I need to create an MX record for a local domain but can't find a spot in Dnsmasq where it can be added.
Until today I used an older version with Unbound, and it worked fine, but I upgraded to 25.7.6, and Unbound did not want to resolve anything, for some reason, so I brought it down and brought up Dnsmasq. Once I found out that its port is set to 0 by default and changed it to 53 it worked. So I lost  the ability to resolve MX on that local domain and am looking at workarounds.

And since we are on this topic, how can I create SRV records? In Unbound, I had them under /usr/local/etc/unbound.opnsense.d/custom.conf
Do I simply add them to /usr/local/etc/dnsmasq.conf and call it a day? But oops, it says:

# DO NOT EDIT THIS FILE -- OPNsense auto-generated file

Thanks everyone
Title: Re: MX record in Dnsmasq
Post by: meyergru on November 02, 2025, 11:10:37 PM
You can add your own files to /usr/local/etc/dnsmasq.conf.d/
Title: Re: MX record in Dnsmasq
Post by: Jyling on November 03, 2025, 05:04:06 AM
Quote from: meyergru on November 02, 2025, 11:10:37 PMYou can add your own files to /usr/local/etc/dnsmasq.conf.d/

That did it! Thanks a lot!
Created both MX and SRV records, after some googling for the format. It was a bit strange that there was no obvious place for TTL in the record, but it is probably hiding somewhere.