[Dnsmasq-discuss] Need help on configuring dnsmasq
Donald Muller
donmuller22 at outlook.com
Mon May 8 15:56:54 UTC 2023
Sent from my iPhone. Please excuse typos and autocorrection errors.
________________________________
From: Dnsmasq-discuss <dnsmasq-discuss-bounces at lists.thekelleys.org.uk> on behalf of Gary R. Schmidt <grschmidt at acm.org>
Sent: Monday, May 8, 2023 11:47 AM
To: dnsmasq-discuss at lists.thekelleys.org.uk <dnsmasq-discuss at lists.thekelleys.org.uk>
Subject: Re: [Dnsmasq-discuss] Need help on configuring dnsmasq
On 09/05/2023 00:10, Buck Horn wrote:
> 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.
>
I will re-state all of this, to see if I have it right:
The OP wants example.com to return 1.2.3.4, but *.example.com to go up
the DNS tree and return the actual IP address.
Using -A/--address doesn't do this, it replies with 1.2.3.4 for
*.example.com as well as example.com, as documented (and presumably as
intended).
Setting example.com to be 1.2.3.4 in /etc/hosts or similar, and not
fiddling around with -A/--address should give the OP the required behaviour.
Is that an accurate summation?
Cheers,
Gary B-)
Might try host-record=example.com,1.2.3.4
_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss at lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20230508/b62fb3d6/attachment-0001.htm>
More information about the Dnsmasq-discuss
mailing list