[DNS] A and AAAA for sub sub domains: fast /easy question (hopefully): give me a confirm/advice, please

Hi everybody,
I need a fast and easy confirm.
Actually I have done

uci add_list dhcp.@dnsmasq[0].address="/home.lan/10.10.10.1"
uci commit dhcp
/etc/init.d/dnsmasq restart

to "redirect" all requests for domain *.home.lan to 10.10.10.1
Now, if I want to redirect the requests of a single subdomain of home.lan, for example nas.home.lan and its related sub sub domains *.nas.home.lan, f.e.:

ftp.nas.home.lan
webdav.nas.home.lan

to another ip, f.e. 10.10.10.2, I can just do:

uci add_list dhcp.@dnsmasq[0].address="/nas.home.lan/10.10.10.2"
uci commit dhcp
/etc/init.d/dnsmasq restart

?

In other words, dns understands that there is a different ip for the more specific subdomain nas.home.lan, even if it has already an entry for home.lan?

Thanks!!!

ps: the [0] in the dhcp.@dnsmasq[0] to what refer? Should/Might use dhcp.@dnsmasq[1]?

Yes.

No. You have only one dnsmasq instance running.

3 Likes

You probably want to use selective DNS forwarding.

1 Like

Thanks to both! But now I have a curiosity....
Is it supported also some sort of pattern matching or wildcard? If I just want to route *-test.myDomain.com, I can just use this string in the hostname(s) part? Or this is the forwarding use case?

Wildcards are not supported and the domain name in the address or server options cannot start with a hyphen. In my opinion, what you want to achieve (*-test.myDomain.com) is not possible.

https://stackoverflow.com/questions/22313142/wildcard-subdomains-with-dnsmasq

1 Like

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