Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Make ipv4 addresses (A rec) default when resolving
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
selig
Guru
Guru


Joined: 31 Jul 2005
Posts: 425
Location: Prague, Czech Republic

PostPosted: Sat Jun 11, 2011 6:11 pm    Post subject: Make ipv4 addresses (A rec) default when resolving Reply with quote

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
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 501
Location: San Diego, California USA

PostPosted: Sat Jun 11, 2011 6:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1261
Location: Idaho, USA

PostPosted: Sat Jun 11, 2011 6:54 pm    Post subject: Reply with quote

The preferred record type is up to the client, not the server.
Back to top
View user's profile Send private message
selig
Guru
Guru


Joined: 31 Jul 2005
Posts: 425
Location: Prague, Czech Republic

PostPosted: Sat Jun 11, 2011 7:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
new_item
n00b
n00b


Joined: 10 Jun 2011
Posts: 20
Location: Poland

PostPosted: Sun Jun 12, 2011 8:35 am    Post subject: Reply with quote

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
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Sun Jun 12, 2011 11:51 am    Post subject: Reply with quote

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
View user's profile Send private message
selig
Guru
Guru


Joined: 31 Jul 2005
Posts: 425
Location: Prague, Czech Republic

PostPosted: Sun Jun 12, 2011 12:31 pm    Post subject: Reply with quote

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. :wink: 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
View user's profile Send private message
mefyl
n00b
n00b


Joined: 15 Nov 2012
Posts: 3
Location: Paris

PostPosted: Thu Nov 15, 2012 1:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
rkfsm
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jun 2005
Posts: 100
Location: Charleston, SC, USA

PostPosted: Sat Mar 16, 2019 1:07 pm    Post subject: Me too Reply with quote

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
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sat Mar 16, 2019 3:37 pm    Post subject: Reply with quote

Quote:
Is there a way to disable ipv6 with wget so that emerge can properly download packages?
  1. Do you need / want IPv6 at all? If not: disable it.

  2. 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
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sun Mar 17, 2019 1:47 am    Post subject: Reply with quote

Dead mirrors should be reported as bugs, btw.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Mar 17, 2019 9:55 am    Post subject: Reply with quote

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
View user's profile Send private message
saturnalia0
Apprentice
Apprentice


Joined: 13 Oct 2016
Posts: 158

PostPosted: Thu Sep 12, 2024 2:34 pm    Post subject: Reply with quote

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
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