On 08.05.2023 15:00:22, "public1020" wrote:

Thanks, dnsmasq does not support this feature.

Why would you think so when you have been pointed to the correct answer from the docs?

Matus UHLAR even quoted the decisive sentence for you:

 it does and the answer is listed in dnsmasq manual page, just where you
 would search for it:

 -A, --address=/<domain>[/<domain>...]/[<ipaddr>]

 ... Note that /etc/hosts and DHCP leases override this for individual name

'address' would specify an IP address to return for any host in the given domains, i.e. including subdomains, so its not fit to satisfy your original request about an individual host name, e.g. for shadowing only example.com, but none of its subdomains.

As the docs quoted by Matus UHLAR state, you may use entries in /etc/hosts to that purpose: Just add some lines with the desired IP and hostname associations to that file.

Of course, that may only work if you wouldn't prevent dnsmasq from reading /etc/hosts. So if your dnsmasq configuration would use the 'no-hosts' option (or if you'd just like to keep things separated), you could configure 'addn-hosts' to point dnsmasq to a separate file with your custom host definitions.

Kind regards,

Dnsmasq-discuss mailing list

Reply via email to