View previous topic :: View next topic |
Author |
Message |
selig Guru
Joined: 31 Jul 2005 Posts: 425 Location: Prague, Czech Republic
|
Posted: Sat Jun 11, 2011 6:11 pm Post subject: Make ipv4 addresses (A rec) default when resolving |
|
|
I have just set up an ipv6 router.
This is my problem:
Code: |
>>> Emerging (1 of 18) x11-proto/xproto-7.0.21
>>> Downloading 'ftp://gentoo.mirror.dkm.cz/pub/gentoo/distfiles/xproto-7.0.21.tar.bz2'
--2011-06-11 19:52:11-- ftp://gentoo.mirror.dkm.cz/pub/gentoo/distfiles/xproto-7.0.21.tar.bz2
=> `/var/tmp/Distfiles/xproto-7.0.21.tar.bz2'
Resolving gentoo.mirror.dkm.cz... 2001:470:1f0b:13d2::49, 86.49.49.49
Connecting to gentoo.mirror.dkm.cz|2001:470:1f0b:13d2::49|:21...
|
This is my ISP's mirror. Apparently, they set up an AAAA record for gentoo.mirror.dkm.cz but the IP address 2001:470:1f0b:13d2::49 is unreachable (or so it seems). I cannot even ping it - however, my IPv6 setup is fine, I can access IPv6 servers without a problem.
I would like the system to prefer IPv4 addresses if both are returned from the DNS query. Is this possible? |
|
Back to top |
|
|
gentoo_ram Guru
Joined: 25 Oct 2007 Posts: 501 Location: San Diego, California USA
|
Posted: Sat Jun 11, 2011 6:31 pm Post subject: |
|
|
You can't really "fix" the DNS query. Instead, maybe the best option is to set the fetch options in /etc/make.conf to include the "-4" flag to wget. Not sure how to do that, but that's approach I would take. |
|
Back to top |
|
|
wswartzendruber Veteran
Joined: 23 Mar 2004 Posts: 1261 Location: Idaho, USA
|
Posted: Sat Jun 11, 2011 6:54 pm Post subject: |
|
|
The preferred record type is up to the client, not the server. |
|
Back to top |
|
|
selig Guru
Joined: 31 Jul 2005 Posts: 425 Location: Prague, Czech Republic
|
Posted: Sat Jun 11, 2011 7:41 pm Post subject: |
|
|
So does it need to be specified for every client (if it has such an option) or is there also a system-wide setting? |
|
Back to top |
|
|
new_item n00b
Joined: 10 Jun 2011 Posts: 20 Location: Poland
|
Posted: Sun Jun 12, 2011 8:35 am Post subject: |
|
|
selig wrote: | So does it need to be specified for every client (if it has such an option) or is there also a system-wide setting? |
I am kind of a n00b when it comes to IPv6. But did you try to add IPv4 record in /etc/hosts ? AFAIK it is searched before dns query, so it might work.
It could be solution for limited amount of domains. |
|
Back to top |
|
|
Veldrin Veteran
Joined: 27 Jul 2004 Posts: 1945 Location: Zurich, Switzerland
|
Posted: Sun Jun 12, 2011 11:51 am Post subject: |
|
|
well plan B would be to remove ipv6 altogether (i.e. in kernel)
a slightly less drastic option is to disable ipv6 protocol wise (edit /etc/modprobe.d/aliases.conf, and enable alias net-pf-10 off). This only works, if ipv6 is built as a module (and not built in).
just my .02$
V. _________________ read the portage output!
If my answer is too concise, ask for an explanation. |
|
Back to top |
|
|
selig Guru
Joined: 31 Jul 2005 Posts: 425 Location: Prague, Czech Republic
|
Posted: Sun Jun 12, 2011 12:31 pm Post subject: |
|
|
So I take it that it is impossible. I have just set up IPv6 because I want it so I am definitely not going to disable it. As a workaround I have put the mirror's IPv4 address into make.conf instead of its hostname and this works (at least until they change the IP address). I just hope that there are not many such sites with broken IPv6... |
|
Back to top |
|
|
mefyl n00b
Joined: 15 Nov 2012 Posts: 3 Location: Paris
|
Posted: Thu Nov 15, 2012 1:16 pm Post subject: |
|
|
I know I'm exhuming a one year old thread, but I had the same problem and came up with (what I think is) a better solution, so it might help anyone with this issue. Since the problem is rsync choosing the ipv6 address, on can simply force it to prefer the ipv4 version by passing it -4. This can be done with the PORTAGE_RSYNC_EXTRA_OPTS option. So, in /etc/make.conf (or /etc/portage/make.conf nowadays):
Code: | PORTAGE_RSYNC_EXTRA_OPTS="-4" |
No need to hardcode an IP in your host file this way.
Cheers, |
|
Back to top |
|
|
rkfsm Tux's lil' helper
Joined: 03 Jun 2005 Posts: 100 Location: Charleston, SC, USA
|
Posted: Sat Mar 16, 2019 1:07 pm Post subject: Me too |
|
|
I know.... this is an ancient thread but this issue is plaguing me. I cannot emerge mirrorselect because I cannot download stuff. Is there a way to disable ipv6 with wget so that emerge can properly download packages?
Russ |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sat Mar 16, 2019 3:37 pm Post subject: |
|
|
Quote: | Is there a way to disable ipv6 with wget so that emerge can properly download packages?
|
- Do you need / want IPv6 at all? If not: disable it.
- Look at the sections below of 'man wget':
- --prefer-family
- --inet4-only
- /etc/wgetrc
- .wgetrc
==> You could add 'prefer-family = IPv4' or 'inet4-only = yes' to /etc/wgetrc.
|
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sun Mar 17, 2019 1:47 am Post subject: |
|
|
Dead mirrors should be reported as bugs, btw. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Sun Mar 17, 2019 9:55 am Post subject: |
|
|
Ant P. wrote: | Dead mirrors should be reported as bugs, btw. |
not the case there
Code: | Resolving gentoo.mirror.dkm.cz... 2001:470:1f0b:13d2::49, 86.49.49.49 |
Code: | ping -c1 -4 gentoo.mirror.dkm.cz
PING mirror.dkm.cz (86.49.49.49) 56(84) bytes of data.
64 bytes from mirror.dkm.cz (86.49.49.49): icmp_seq=1 ttl=48 time=67.5 ms
|
i don't have ipv6 to tell if the server ipv6 config is at fault or user one. |
|
Back to top |
|
|
saturnalia0 Apprentice
Joined: 13 Oct 2016 Posts: 158
|
Posted: Thu Sep 12, 2024 2:34 pm Post subject: |
|
|
Sorry to revive an old thread, but since I got here from Google this might be useful to someone else.
If using dnsmasq, simply
Code: |
echo 'filter-AAAA' >/etc/dnsmasq.conf
rc-service dnsmasq restart
|
From the manual:
Quote: |
--filter-AAAA
Remove AAAA records from answers. No IPv6 addresses will be returned.
|
So this is not exactly what OP wanted as IPV6 will be dropped, not put at the end of the list, but... it solves the issue originally reported (and others).
Worth reminding that /etc/resolv.conf should be
Code: |
nameserver 127.0.0.1
nameserver your-dns-server-of-choice
|
In order to use dnsmaq. See also /etc/gai.conf. |
|
Back to top |
|
|
|