| 25 May 2021 |
alexey96 | networking.useDHCP = false;
networking.interfaces.eno0.useDHCP = true;
networking.interfaces.wlp2s0.useDHCP = true;
networking.nameservers = [ "127.0.0.1" "::1" ];
| 17:52:55 |
andi- | That log is interesting. As you've set no-resolv it should only use the server statements to do the resolving. What arguments is dnsmasq launched with? | 17:53:04 |
alexey96 | How can i get that information? | 17:54:46 |
andi- | systemctl cat dnsmasq should show you the cmdline that process was launched with | 17:55:03 |
andi- | or rather systemctl status dnsmasq | 17:55:12 |
alexey96 | /nix/store/zsdx9lmnjma8xdv2acz4ha0hi45wkxvh-dnsmasq-2.85/bin/dnsmasq -k --enable-dbus --user=dnsmasq -C /nix/store/x4nvgi8mz9vj1myfb6hbsd8vh7zxlm57-dnsmasq.conf | 17:56:10 |
alexey96 | * So the only option I see to prevent this looping is removing ip 192.168.1.1 from resolv.conf on the NixOS machine and i have trouble with this | 18:04:06 |
andi- | alexey96: try passing a dummy resolv.conf to dnsmasq via the resolv-file=... argument.. I somehow suspec that server=.. isn't doing exactly the right thing. Dnsmasq might fall back to libc based DNS and then end up on your router again? | 18:04:14 |
andi- | In the config block above you could write
resolv-file=${pkgs.writeText "dnsmasq-resolv.conf" "nameserver 8.8.8.8"}
| 18:05:21 |
andi- | (Obviously add the v6 address as well I was just lazy) | 18:05:53 |
alexey96 | In reply to @andi:kack.it
In the config block above you could write
resolv-file=${pkgs.writeText "dnsmasq-resolv.conf" "nameserver 8.8.8.8"}
Had no effect. dsnmasq-resolve.conf didnt change, still 100% cpu usage | 18:13:24 |
alexey96 | cat /etc/dnsmasq-resolv.conf
Generated by resolvconf
nameserver 192.168.1.100 nameserver 192.168.1.1
| 18:13:39 |
andi- | what is that file relevant? I don't see it in the earlier pastes. Did you declare that? | 18:18:28 |
alexey96 | I didnt declare it anyway before. Shouldn't the resolv-file=... change it? | 18:26:50 |
alexey96 | * I didnt declare it in anyway before. Shouldn't the resolv-file=... change it? | 18:27:05 |
andi- | no, that only tells it which file to read. It shouldn't read that file on disk | 18:27:46 |
alexey96 | So dnsmasq starts with paramaters: /nix/store/zsdx9lmnjma8xdv2acz4ha0hi45wkxvh-dnsmasq-2.85/bin/dnsmasq -k --enable-dbus --user=dnsmasq -C /nix/store/a48s6kwn7clmqz9kf8wmf648jj5j76z8-dnsmasq.conf | 18:47:33 |
alexey96 | dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases
conf-file=/etc/dnsmasq-conf.conf
resolv-file=/etc/dnsmasq-resolv.conf
domain-needed
bogus-priv
no-resolv
filterwin2k
server=208.67.220.220
server=8.8.8.8
listen-address=::1,127.0.0.1,192.168.1.100
bind-interfaces
cache-size=10000
log-queries
log-facility=/tmp/ad-block.log
local-ttl=300
resolv-file=/nix/store/ks8wii7ff51jb1f1ln0sdamwv6syy1v6-dnsmasq-resolv.conf
conf-file=/etc/nixos/assets/hosts-blocklists/domains.txt
addn-hosts=/etc/nixos/assets/hosts-blocklists/hostnames.txt
# address=/nixos.home/192.168.1.100
| 18:49:13 |
alexey96 | * dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases
conf-file=/etc/dnsmasq-conf.conf
resolv-file=/etc/dnsmasq-resolv.conf
domain-needed
bogus-priv
no-resolv
filterwin2k
server=208.67.220.220
server=8.8.8.8
listen-address=::1,127.0.0.1,192.168.1.100
bind-interfaces
cache-size=10000
log-queries
log-facility=/tmp/ad-block.log
local-ttl=300
resolv-file=/nix/store/ks8wii7ff51jb1f1ln0sdamwv6syy1v6-dnsmasq-resolv.conf
conf-file=/etc/nixos/assets/hosts-blocklists/domains.txt
addn-hosts=/etc/nixos/assets/hosts-blocklists/hostnames.txt
# address=/nixos.home/192.168.1.100
| 18:49:50 |
alexey96 | * dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases
conf-file=/etc/dnsmasq-conf.conf
resolv-file=/etc/dnsmasq-resolv.conf
domain-needed
bogus-priv
no-resolv
filterwin2k
server=208.67.220.220
server=8.8.8.8
listen-address=::1,127.0.0.1,192.168.1.100
bind-interfaces
cache-size=10000
log-queries
log-facility=/tmp/ad-block.log
local-ttl=300
resolv-file=/nix/store/ks8wii7ff51jb1f1ln0sdamwv6syy1v6-dnsmasq-resolv.conf
conf-file=/etc/nixos/assets/hosts-blocklists/domains.txt
addn-hosts=/etc/nixos/assets/hosts-blocklists/hostnames.txt
# address=/nixos.home/192.168.1.100
| 18:50:42 |
alexey96 | * dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases
conf-file=/etc/dnsmasq-conf.conf
resolv-file=/etc/dnsmasq-resolv.conf
domain-needed
bogus-priv
no-resolv
filterwin2k
server=208.67.220.220
server=8.8.8.8
listen-address=::1,127.0.0.1,192.168.1.100
bind-interfaces
cache-size=10000
log-queries
log-facility=/tmp/ad-block.log
local-ttl=300
resolv-file=/nix/store/ks8wii7ff51jb1f1ln0sdamwv6syy1v6-dnsmasq-resolv.conf
conf-file=/etc/nixos/assets/hosts-blocklists/domains.txt
addn-hosts=/etc/nixos/assets/hosts-blocklists/hostnames.txt
# address=/nixos.home/192.168.1.100
| 18:50:50 |
alexey96 | * dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases
conf-file=/etc/dnsmasq-conf.conf
resolv-file=/etc/dnsmasq-resolv.conf
domain-needed
bogus-priv
no-resolv
filterwin2k
server=208.67.220.220
server=8.8.8.8
listen-address=::1,127.0.0.1,192.168.1.100
bind-interfaces
cache-size=10000
log-queries
log-facility=/tmp/ad-block.log
local-ttl=300
resolv-file=/nix/store/ks8wii7ff51jb1f1ln0sdamwv6syy1v6-dnsmasq-resolv.conf
conf-file=/etc/nixos/assets/hosts-blocklists/domains.txt
addn-hosts=/etc/nixos/assets/hosts-blocklists/hostnames.txt
# address=/nixos.home/192.168.1.100
| 18:51:11 |
alexey96 | * cat /nix/store/a48s6kwn7clmqz9kf8wmf648jj5j76z8-dnsmasq.conf``` dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases conf-file=/etc/dnsmasq-conf.conf resolv-file=/etc/dnsmasq-resolv.conf
domain-needed bogus-priv no-resolv filterwin2k
server=208.67.220.220 server=8.8.8.8
listen-address=::1,127.0.0.1,192.168.1.100 bind-interfaces
cache-size=10000 log-queries log-facility=/tmp/ad-block.log local-ttl=300
resolv-file=/nix/store/ks8wii7ff51jb1f1ln0sdamwv6syy1v6-dnsmasq-resolv.conf conf-file=/etc/nixos/assets/hosts-blocklists/domains.txt addn-hosts=/etc/nixos/assets/hosts-blocklists/hostnames.txt
address=/nixos.home/192.168.1.100
| 18:51:19 |
alexey96 | * cat /nix/store/a48s6kwn7clmqz9kf8wmf648jj5j76z8-dnsmasq.conf ``` dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases conf-file=/etc/dnsmasq-conf.conf resolv-file=/etc/dnsmasq-resolv.conf
domain-needed bogus-priv no-resolv filterwin2k
server=208.67.220.220 server=8.8.8.8
listen-address=::1,127.0.0.1,192.168.1.100 bind-interfaces
cache-size=10000 log-queries log-facility=/tmp/ad-block.log local-ttl=300
resolv-file=/nix/store/ks8wii7ff51jb1f1ln0sdamwv6syy1v6-dnsmasq-resolv.conf conf-file=/etc/nixos/assets/hosts-blocklists/domains.txt addn-hosts=/etc/nixos/assets/hosts-blocklists/hostnames.txt
address=/nixos.home/192.168.1.100
| 18:51:26 |
alexey96 | cat /nix/store/ks8wii7ff51jb1f1ln0sdamwv6syy1v6-dnsmasq-resolv.conf nameserver 8.8.8.8 | 18:53:15 |
andi- | That resolv-file=/etc/dnsmasq-resolv.conf line is still odd as that will lead to recursion | 18:54:21 |
alexey96 | So, specified in configuration.nix resolv-file=... was passed to dnsmasq, but didnt overwrite default settings? | 18:54:31 |
andi- | not sure if they are merged or if the last one takes precedence.. | 18:55:02 |
andi- | Usually I just use unbound for this kind of setup | 18:55:09 |
alexey96 | I will try unbound then. Thank you for support! | 18:55:52 |