DNS resolves to IPv6 addresses when IPv6 is not available.

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
FreshMinty
Level 1
Level 1
Posts: 3
Joined: Wed Nov 29, 2017 7:14 pm

DNS resolves to IPv6 addresses when IPv6 is not available.

Post by FreshMinty » Fri Jan 12, 2018 8:27 am

Hey there!

I've got a problem with my notebook running LM 18.3.

I'm often switching between various networks. Sometimes, when I was within an IPv6 enabled network and then switch to an IPv4 only network, many websites can't be reached.
When I try to 'wget' a website on my server for example, It fails with "failed: Network is unreachable." because it tries to connect to the IPv6 address.
So the resolver seems to query IPv6 addresses even if an IPv6 connection isn't possible.

In such cases I tried clearing the DNS cache using "sudo service dns-clean start", but without any success.
The only workaround I've found is to use Chromium instead of Firefox, which somehow works...

Do you have any ideas how to fix that?

Thanks in advance!

User avatar
littlehuman
Level 1
Level 1
Posts: 33
Joined: Sun Jan 07, 2018 7:41 pm

Re: DNS resolves to IPv6 addresses when IPv6 is not available.

Post by littlehuman » Fri Jan 12, 2018 2:12 pm

I only share my point of view and do not say that it is right, etc, but I guess that as GAFA, Alphabet/Google is a main actor of the Internet and therefore promote ipv6, this may explains why it "works better" with Chromium.

If you do not absolutely need it, I would suggest to disable ipv6 (I don't say that it's right but I always disable ipv6, both on my win and ux machines). On mint I disabled it by simply adding ipv6.disable=1 to the GRUB_CMDLINE_LINUX_DEFAULT of /etc/default/grub

Mine looks like this :

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"
If you opt for disabling ipv6 and edited your /etc/default/grub, don't forget to execute this :

Code: Select all

sudo update-grub
Then restart your computer, and by executing ifconfig, you will be in IPV4 only :

Code: Select all

wlp3s0    Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  
          inet addr:192.168.1.107  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:119811 errors:0 dropped:0 overruns:0 frame:0
          TX packets:65492 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:172612653 (172.6 MB)  TX bytes:6996402 (6.9 MB)
You can easily undo your change. This may just be a workaround for you.
"Bruce Schneier taught Chuck Norris how to divide by zero as they stood silent in an elevator" - schneierfacts.com

FreshMinty
Level 1
Level 1
Posts: 3
Joined: Wed Nov 29, 2017 7:14 pm

Re: DNS resolves to IPv6 addresses when IPv6 is not available.

Post by FreshMinty » Fri Jan 12, 2018 3:22 pm

Oh dear,

I can't describe my own dumbness in words.. :oops:

I had my server's IPv6 address in my /etc/hosts file the whole time.
That was the reason why Firefox and the Nextcloud sync client weren't able to connect to it.

Thanks for your efforts though, littlehuman.

Topic can be closed. :roll:

User avatar
littlehuman
Level 1
Level 1
Posts: 33
Joined: Sun Jan 07, 2018 7:41 pm

Re: DNS resolves to IPv6 addresses when IPv6 is not available.

Post by littlehuman » Sat Jan 13, 2018 8:42 am

You're welcome
"Bruce Schneier taught Chuck Norris how to divide by zero as they stood silent in an elevator" - schneierfacts.com

Post Reply

Return to “Other networking topics”