Yunohost with example.com (maindomain) resolves sub.example.com to local ip, but global A record is different

Hello all,
thanks for helping me.

My YunoHost server

Hardware: VPS on a server I have.

YunoHost version: 4.0.8.2 (stable).

I have access to my server : Through SSH | through the webadmin

Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

I just found that my Yunohost resolves all of the subdomains of its domains to the local IPs. This is not ok. I know the DNS configuration suggests to set a wildcards domain (*), but for some domain I just want to run the MX on my Yunohost and now resolving sub.example.com to the local host is just incorrect.

What can I do in order to change this behaviour?

So for example.com only the following DNS settings point to the Yunohost:
MX for AAAA
MX for A

When I do dig dig.example.com it shows the correct IP which I configured for the subdomain in the DNS settings of my domain provider.
When I do dig dig.example.com @localhost IPv4 of my Yunohost server is shown, which is incorrect, at least globally it is not published like this.

Not sure to 100% understand the issue but my best guess is that you may want to remove the “mx-host” line in /etc/dnsmasq.d/yourdomain.tld (for the appropriate domain you’re concerned about)

(Then reload/restart dnsmasq, and beware of cache issues, maybe run nscd -i hosts)

This it the right direction. Thanks for helping me, I knew it was some local DNS configuration, but wasn’t sure how to find it.

I think here I can just comment out everything except the mx-host, as I only want to host the MX on my Yunohost.

This function is only nice if you have a broken DNS resolution, I mean yes resolving to localhost can be done with a setting like this, but it can certainly mess up things. I would assume that it is a common thing to have some subdomains running on other servers with other IPv4/IPv6.

So I manually edit the file and then every time Yunohost will complain about it?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.