Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-15 Thread public1020 via Dnsmasq-discuss
I came back. These two solutions worked for me:

- addn-hosts=/etc/dnsmasq-hosts

- host-record=example.com,1.2.3.4

Hopefully it would help someone.
--- Original Message ---
On Tuesday, May 9th, 2023 at 3:14 AM, Elisamuel Resto  wrote:

> What I do, which seems to work (for me):
>
> host-record=example.com/1.2.3.4
>
> Regards,
> -Sam
>
>> On May 7, 2023, at 23:01, public1020 via Dnsmasq-discuss 
>>  wrote:
>
>> 
>> I'm trying to use dnsmasq to hijackexample.com, but notapi.example.com, so I 
>> used the following configuration:
>>
>> address=/example.com/192.168.1.10
>>
>> However, dnsmasq also hijacks *.example.com to this IP address. Now how can 
>> I hijack only the specific address with dnsmasq?
>>
>> ___
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss@lists.thekelleys.org.uk
>> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-11 Thread Petr Menšík
Use host-record=example.com,IP instead. Use host-record=example.com,:: 
if that name does not have IPv6 address. Do you need to override any 
records queries for that name, not just addresses?


On 5/8/23 08:23, public1020 via Dnsmasq-discuss wrote:

I want dnsmasq to do exact match, e.g "address=/example.com/IP" should only 
match example.com, not *.example.com.

Does dnsmasq support that?

--- Original Message ---
On Monday, May 8th, 2023 at 1:49 PM, Monthly Posting 
 wrote:



On Mon, May 08, 2023 at 03:45:29AM +, public1020 wrote:


I'm trying to use dnsmasq to hijack example.com, but not
api.example.com, so I used the following configuration:
address=/example.com/192.168.1.10

However, dnsmasq also hijacks *.example.com to this IP address.
Now how can I hijack only the specific address with dnsmasq?


Play with two changes in the configuration:

api.example.com=valid_address
example.com=hijack_address


See manual page for actual syntax.
Karma bonus points for sharing what works.


Regards
Monthly Posting
--
https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2023q2/017067.html


--
Petr Menšík
Software Engineer, RHEL
Red Hat, https://www.redhat.com/
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-08 Thread Elisamuel Resto
What I do, which seems to work (for me):

host-record=example.com/1.2.3.4

Regards,
-Sam

> On May 7, 2023, at 23:01, public1020 via Dnsmasq-discuss 
>  wrote:
> 
> 
> I'm trying to use dnsmasq to hijack example.com, but not api.example.com, so 
> I used the following configuration:
> 
> address=/example.com/192.168.1.10
> However, dnsmasq also hijacks *.example.com to this IP address. Now how can I 
> hijack only the specific address with dnsmasq?
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-08 Thread Matus UHLAR - fantomas

On 09.05.23 00:57, Gary R. Schmidt wrote:

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?


yes.

--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Micro$oft random number generator: 0, 0, 0, 4.33e+67, 0, 0, 0...

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-08 Thread Donald Muller


Sent from my iPhone. Please excuse typos and autocorrection errors.


From: Dnsmasq-discuss  on 
behalf of Gary R. Schmidt 
Sent: Monday, May 8, 2023 11:47 AM
To: dnsmasq-discuss@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=/[/...]/[]
>>> ... 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,
GaryB-)

Might try host-record=example.com,1.2.3.4




___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-08 Thread Gary R. Schmidt

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=/[/...]/[]
... 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,
GaryB-)



___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-08 Thread Buck Horn

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=/[/...]/[]



 ... 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,
Buck

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-08 Thread Gary R. Schmidt

On 08/05/2023 23:00, public1020 via Dnsmasq-discuss wrote:

Thanks, dnsmasq does not support this feature. I will match all
subdomains regardless.

Case closed :-)


The man page says that it does what you've described:

-A, --address=/[/...]/[]
...
  /etc/hosts and DHCP leases override this for individual names. A
  common use of this is to  redirect  the  entire  doubleclick.net
  domain  to  some  friendly local web server to avoid banner ads.
  The domain specification works in the same way as for  --server,
...

A quick gander over the source code implies that changing this would not 
be trivial.  :-)


Cheers,
GaryB-)

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-08 Thread public1020 via Dnsmasq-discuss
Thanks, dnsmasq does not support this feature. I will match all subdomains 
regardless.

Case closed :-)

--- Original Message ---
On Monday, May 8th, 2023 at 4:50 PM, Matus UHLAR - fantomas  
wrote:


> > On Monday, May 8th, 2023 at 1:49 PM, Monthly Posting 
> > dnsmasq-discuss@lists.thekelleys.org.uk wrote:
> > 
> > > On Mon, May 08, 2023 at 03:45:29AM +, public1020 wrote:
> > > 
> > > > I'm trying to use dnsmasq to hijack example.com, but not
> > > > api.example.com, so I used the following configuration:
> > > > address=/example.com/192.168.1.10
> > > > 
> > > > However, dnsmasq also hijacks *.example.com to this IP address.
> > > > Now how can I hijack only the specific address with dnsmasq?
> 
> > > Play with two changes in the configuration:
> > > 
> > > api.example.com=valid_address
> > > example.com=hijack_address
> > > 
> > > See manual page for actual syntax.
> > > Karma bonus points for sharing what works.
> 
> 
> On 08.05.23 06:23, public1020 via Dnsmasq-discuss wrote:
> 
> > I want dnsmasq to do exact match, e.g "address=/example.com/IP" should only 
> > match example.com, not *.example.com.
> > 
> > Does dnsmasq support that?
> 
> 
> it does and the answer is listed in dnsmasq manual page, just where you
> would search for it:
> 
> -A, --address=/[/...]/[]
> 
> 
> 
> ... Note that /etc/hosts and DHCP leases override this for individual names.
> 
> 
> 
> --
> Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
> Warning: I wish NOT to receive e-mail advertising to this address.
> Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
> You have the right to remain silent. Anything you say will be misquoted,
> then used against you.
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-08 Thread Matus UHLAR - fantomas

On Monday, May 8th, 2023 at 1:49 PM, Monthly Posting 
 wrote:

On Mon, May 08, 2023 at 03:45:29AM +, public1020 wrote:

> I'm trying to use dnsmasq to hijack example.com, but not
> api.example.com, so I used the following configuration:
> address=/example.com/192.168.1.10
>
> However, dnsmasq also hijacks *.example.com to this IP address.
> Now how can I hijack only the specific address with dnsmasq?



Play with two changes in the configuration:

api.example.com=valid_address
example.com=hijack_address

See manual page for actual syntax.
Karma bonus points for sharing what works.


On 08.05.23 06:23, public1020 via Dnsmasq-discuss wrote:

I want dnsmasq to do exact match, e.g "address=/example.com/IP" should only 
match example.com, not *.example.com.

Does dnsmasq support that?


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


-A, --address=/[/...]/[]


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



--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
You have the right to remain silent. Anything you say will be misquoted,
then used against you.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-07 Thread public1020 via Dnsmasq-discuss
I want dnsmasq to do exact match, e.g "address=/example.com/IP" should only 
match example.com, not *.example.com.

Does dnsmasq support that?

--- Original Message ---
On Monday, May 8th, 2023 at 1:49 PM, Monthly Posting 
 wrote:


> On Mon, May 08, 2023 at 03:45:29AM +, public1020 wrote:
> 
> > I'm trying to use dnsmasq to hijack example.com, but not
> > api.example.com, so I used the following configuration:
> > address=/example.com/192.168.1.10
> > 
> > However, dnsmasq also hijacks *.example.com to this IP address.
> > Now how can I hijack only the specific address with dnsmasq?
> 
> 
> Play with two changes in the configuration:
> 
> api.example.com=valid_address
> example.com=hijack_address
> 
> 
> See manual page for actual syntax.
> Karma bonus points for sharing what works.
> 
> 
> Regards
> Monthly Posting
> --
> https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2023q2/017067.html
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-07 Thread Monthly Posting
On Mon, May 08, 2023 at 03:45:29AM +, public1020 wrote:
> I'm trying to use dnsmasq to hijack example.com, but not
> api.example.com, so I used the following configuration:
> address=/example.com/192.168.1.10
> 
> However, dnsmasq also hijacks *.example.com to this IP address.
> Now how can I hijack only the specific address with dnsmasq?

Play with **two** changes in the configuration:

api.example.com=valid_address
example.com=hijack_address


See manual page for actual syntax.
Karma bonus points for sharing what works.


Regards
Monthly Posting
-- 
https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2023q2/017067.html

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Need help on configuring dnsmasq

2023-05-07 Thread public1020 via Dnsmasq-discuss
I'm trying to use dnsmasq to hijackexample.com, but notapi.example.com, so I 
used the following configuration:

address=/example.com/192.168.1.10

However, dnsmasq also hijacks *.example.com to this IP address. Now how can I 
hijack only the specific address with dnsmasq?___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss