Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] DNS works on IPV6, but not on IPV4
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
saturnalia0
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2016
Posts: 94

PostPosted: Thu Dec 29, 2016 2:56 am    Post subject: [Solved] DNS works on IPV6, but not on IPV4 Reply with quote

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 (given that 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). Yes, 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?

I started a new thread because the old one was polluted with confusing and irrelevant Q&A until I accidentally found out the relation to IPV4/6, sorry if this should be posted there nevertheless.

My resolv.conf (IPV4):

Code:

# dnsmasq - this has always worked, I also tried removing it and it doesn't solve anything, the issue has nothing to do with it
nameserver 127.0.0.1
# OpenNIC
nameserver 31.171.155.107
nameserver 79.133.43.124


IPV6 (working in the IPV6 router):

Code:

# 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


Last edited by saturnalia0 on Thu Jan 05, 2017 9:39 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Sat Dec 31, 2016 5:29 am    Post subject: Reply with quote

Does your IPV4 stack work? can you ping IP addresses or even the nameservers?

You can try running nslookup google.com and see if it reports something?

Also you could temporarily try using Google's DNS server 8.8.8.8 and see if it changes behavior?

I have a caching nameserver so 127.0.0.1 makes sense for me...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
saturnalia0
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2016
Posts: 94

PostPosted: Wed Jan 04, 2017 11:04 am    Post subject: Reply with quote

eccerr0r wrote:
Does your IPV4 stack work? can you ping IP addresses or even the nameservers?


As mentioned in the other thread ping 8.8.8.8 works, I can ping all my nameservers as well. Not sure if this means "my ipv4 stack works", I'm a complete noob when it comes to networking!

eccerr0r wrote:
You can try running nslookup google.com and see if it reports something?

Also you could temporarily try using Google's DNS server 8.8.8.8 and see if it changes behavior?


I did this and other tests in the aforelinked thread, the result is always the same:

$ nslookup google.com 8.8.8.8
connection timed out: no servers could be reached.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Wed Jan 04, 2017 5:23 pm    Post subject: Reply with quote

You indeed have a very strange problem... mainly because it looks like it gives up on resolving the host without trying.

So all your ipv4 and ipv6 nameservers should be in /etc/resolv.conf, why you've split them I'm not sure.

Can you clear out your /etc/sysctl.conf and see what happens without it (may need reboot)?
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
saturnalia0
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2016
Posts: 94

PostPosted: Thu Jan 05, 2017 9:39 am    Post subject: Reply with quote

I found the issue after a hint from a user at unix.stackexchange.org, it's very silly actually. It was an iptables nat rule that I used in a previous tor config to prevent DNS leaks, found at the Gentoo wiki: https://wiki.gentoo.org/wiki/Tor#TORDNS_Resolver

I thought `iptables -F ; iptables -X` was enough to get rid of it (and `iptables -L` didn't display anything). IPV6 worked because there were no ip6tables rules for it. I added information to the Gentoo wiki on how to properly disable the iptables rules so other noobs like me don't go though the same trouble. I also mentioned ip6tables, might be worth it. Thanks everyone for the help.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13496

PostPosted: Fri Jan 06, 2017 2:26 am    Post subject: Reply with quote

Your iptables -F ; iptables -X flushed and deleted user chains from the target table, which by default would be table filter. It had no effect on any other tables, such as mangle, nat, raw, and security. If you want to see all your iptables rules, you either need to run iptables -L on each table individually or use iptables-save, which will show all of them by default.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum