At my place I have a router that gives me an IPV4 address. My Gentoo PC works fine but my Gentoo laptop stopped resolving names. I visited my parents and tried connecting to their router, which gives me an IPV6 address, and presto, everything was back to normal (I added the IPV6 equivalents of my nameservers to /etc/resolv.conf). Then I tried another router in my parent's network, which sits behind the IPV6 one but which gives me an IPV4 address, and then again I can't resolve names (though if I boot a Gentoo LiveCD I can, so it's a configuration issue on my laptop and related to IPV4) (I re-added the IPV4 addresses back to /etc/resolv.conf, and I also tried leaving the IPV6 ones). I can ping addresses just fine, I just can't resolve names. What could be causing this and how could I fix it?
My resolv.conf (IPV4, used to work in the past):
# dnsmasq nameserver 127.0.0.1 # OpenNIC nameserver 184.108.40.206 nameserver 220.127.116.11
IPV6 (working in the IPV6 router):
# dnsmasq nameserver ::1 # OpenNIC nameserver 2a05:dfc7:5::53 nameserver 2001:19f0:7001:929:5400:00ff:fe30:50af
Notice that the IPV4 one used to work on the IPV4 routers, it stopped working without me modifying it. Something else got modified and name resolving stopped working. My entire /etc folder (except ssl, shadow, etc) can be found here.
I flushed all iptables rules and set all policies to ACCEPT. No network related
services are running except dnsmasq (I tried disabling it and removing the
localhost line from resolv.conf, to no avail). I connect to the internet using
bare wpa_supplicant and and ip, and it works fine, it's just the name resolving
which does not (not even when connecting though the wired interface using
Gentoo's rc scripts). Both
iptables -L and
ip6tables -L return:
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
Some tests and their results (all on an IPV4 router connected wirelessly, though the results are the same with a wired connection):
$ nslookup google.com 18.104.22.168 ;; connection timed out: no servers could be reached.
$ dig @22.214.171.124 gentoo.org ;; connection timed out: no servers could be reached.
tcpdump registers nothing when trying to ping a hostname such as google.com, but successfully register ICMP echoes when pinging an IP address:
$ ping gentoo.org ping: unknown host gentoo.org $ ping 126.96.36.199 PING 188.8.131.52 (184.108.40.206) 56(84) bytes of data. 64 bytes from 220.127.116.11: icmp_seq=1 ttl=48 time=74.0 ms 64 bytes from 18.104.22.168: icmp_seq=2 ttl=48 time=73.7 ms 64 bytes from 22.214.171.124: icmp_seq=3 ttl=48 time=73.7 ms ^C --- 126.96.36.199 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 73.708/73.810/74.012/0.344 ms
$ tcpdump -i wlp3s0 port 53 dropped privs to tcpdump tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on wlp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes ^C 0 packets captured 0 packets received by filter 0 packets dropped by kernel $ tcpdump -i wlp3s0 dropped privs to tcpdump tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on wlp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes 07:05:55.807483 IP 192.168.25.11 > 188.8.131.52: ICMP echo request, id 5903, seq 1, length 64 07:05:55.881446 IP 184.108.40.206 > 192.168.25.11: ICMP echo reply, id 5903, seq 1, length 64 07:05:56.808617 IP 192.168.25.11 > 220.127.116.11: ICMP echo request, id 5903, seq 2, length 64 07:05:56.882287 IP 18.104.22.168 > 192.168.25.11: ICMP echo reply, id 5903, seq 2, length 64 07:05:57.810421 IP 192.168.25.11 > 22.214.171.124: ICMP echo request, id 5903, seq 3, length 64 07:05:57.884089 IP 126.96.36.199 > 192.168.25.11: ICMP echo reply, id 5903, seq 3, length 64 ^C 6 packets captured 6 packets received by filter 0 packets dropped by kernel
ifconfig on the ipv4 router:
wlp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.25.11 netmask 255.255.255.0 broadcast 192.168.25.255 inet6 fe80::16ec:71f7:dcc5:f175 prefixlen 64 scopeid 0x20<link> ether 00:07:c8:82:a2:96 txqueuelen 1000 (Ethernet) RX packets 6 bytes 568 (568.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 24 bytes 4038 (3.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ ip route default via 192.168.25.1 dev wlp3s0 169.254.0.0/16 dev wlp3s0 proto kernel scope link src 169.254.144.184 metric 304 192.168.25.0/24 dev wlp3s0 proto kernel scope link src 192.168.25.11
# /etc/nsswitch.conf: # $Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nsswitch.conf,v 1.1 2006/09/29 23:52:23 vapier Exp $ passwd: compat shadow: compat group: compat # passwd: db files nis # shadow: db files nis # group: db files nis hosts: files dns networks: files dns services: db files protocols: db files rpc: db files ethers: db files netmasks: files netgroup: files bootparams: files automount: files aliases: files
I also ran
strace -e open dig @188.8.131.52 gentoo.org and the last thing it does
is open /etc/resolv.conf (successfully).