Re: [Dnsmasq-discuss] How to resolve resolv.conf problems?

2021-12-06 Thread Chris Green
Well, after chasing around for some days and looking for answers to
this issue I have decided that Network Manager is the problem.

On my Raspberry Pi systems with no Network Manager it all configures
correctly when you install dnsmasq.  /etc/resolv.conf has "nameserver
127.0.0.1" in it and /run/dnsmasq/resolv.conf has "nameserver
192.168.1.2" (which is correct for me as 192.168.1.2 is the DNS server
for my LAN) and dnsmasq is run with "-r /run/dnsmasq/resolv.conf". 

However, whatever I have tried, on this xubuntu 21.10 laptop it
configures as above *except* that /run/dnsmasq/resolv.conf is empty,
it says "# Generated by resolvconf" but has nothing in it.

So, what I have done is to put a file in /etc/dnsmasq.d containing
just the one line:-
resolv-file=/run/NetworkManager/no-stub-resolv.conf

The file /run/NetworkManager/no-stub-resolv.conf does contain the
correct upstream DNS server.

I suspect that Network Manager with dns=dnsmasq in the configuration
file is supposed to configure things correctly (as on the Pi above)
but for some reason it doesn't work quite right.

However my workaround isn't too onerous and means my laptop can run
dnsmasq and will use whatever DNS is provided by the network it is
connected to.

-- 
Chris Green

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


Re: [Dnsmasq-discuss] How to resolve resolv.conf problems?

2021-12-04 Thread Chris Green
On Sat, Dec 04, 2021 at 02:55:08PM +, Chris Green wrote:
> 
> As a final question, if one wants dnsmasq to do local cacheing do you
> put 'nameserver 127.0.0.1' in the resolv.conf file and then provide
> the upstream dns server elsewhere in the configuration?
> 
I think this is mostly explained by the dnsmasq man page:-

   In order to configure dnsmasq to act as cache for the host on which it 
is running, put
   "nameserver 127.0.0.1" in /etc/resolv.conf to force local processes to 
send queries to
   dnsmasq.  Then  either specify the upstream servers directly to dnsmasq 
using --server
   options or put their addresses real in another file, say 
/etc/resolv.dnsmasq  and  run
   dnsmasq  with  the --resolv-file /etc/resolv.dnsmasq option. This second 
technique al‐
   lows for dynamic update of the server addresses by PPP or DHCP.

Does this mean that the configuration on the Raspberry Pi is correct?
(as described at the start of this thread)


Many, many tutorials one can find on the internet have /etc/resolv.conf
like this:-

search this.lan
nameserver 127.0.0.1
nameserver 8.8.8.8

I assume this is just plain wrong!

-- 
Chris Green

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