I have a simple rule to point my domain.tld
to a local address 192.168.0.205
. It takes everything; all subdomains *.domain.tld
as well as the main domain itself.
local-zone: "domain.tld." redirect
local-data: "domain.tld. IN A 192.168.0.205"
I have my load balancer at 192.168.0.205
so for making requests working internally I need to do this. However, my mail server is located outside this network, so I need to make three exceptions to this; smtp.domain.tld
, imap.domain.tld
and domain.tld
itself. I'd prefer if I just could make those slip through to the ISP's dns, but if that is not possible I can live with having to set their global ip's in my config.
How can I do this? I've tried using transparent
instead of redirect
but I cannot make it work like I want. I think one of the main problems is to handle the main domain without subdomain prefix.
Use this style, multiple level wildcard subdomains:
This configuration worked for me using Unbound v1.9.0:
Note that the order of these statements matters. Write your rules from most specific to least specific.
To make an MX record work, you can use the following construct. Use transparent for the mail-server subdomain. And add the MX record to the redirect part.