Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Make ipv4 addresses (A rec) default when resolving

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
13 posts • Page 1 of 1
Author
Message
selig
Guru
Guru
User avatar
Posts: 425
Joined: Sun Jul 31, 2005 4:58 pm
Location: Prague, Czech Republic

Make ipv4 addresses (A rec) default when resolving

  • Quote

Post by selig » Sat Jun 11, 2011 6:11 pm

I have just set up an ipv6 router.
This is my problem:

Code: Select all

>>> 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?
Top
gentoo_ram
Guru
Guru
Posts: 528
Joined: Thu Oct 25, 2007 10:04 pm
Location: San Diego, California USA

  • Quote

Post by gentoo_ram » Sat Jun 11, 2011 6:31 pm

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.
Top
wswartzendruber
Veteran
Veteran
User avatar
Posts: 1261
Joined: Tue Mar 23, 2004 1:16 am
Location: Idaho, USA

  • Quote

Post by wswartzendruber » Sat Jun 11, 2011 6:54 pm

The preferred record type is up to the client, not the server.
Top
selig
Guru
Guru
User avatar
Posts: 425
Joined: Sun Jul 31, 2005 4:58 pm
Location: Prague, Czech Republic

  • Quote

Post by selig » Sat Jun 11, 2011 7:41 pm

So does it need to be specified for every client (if it has such an option) or is there also a system-wide setting?
Top
new_item
n00b
n00b
Posts: 20
Joined: Fri Jun 10, 2011 2:11 pm
Location: Poland

  • Quote

Post by new_item » Sun Jun 12, 2011 8:35 am

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.
Top
Veldrin
Veteran
Veteran
User avatar
Posts: 1945
Joined: Tue Jul 27, 2004 5:47 pm
Location: Zurich, Switzerland

  • Quote

Post by Veldrin » Sun Jun 12, 2011 11:51 am

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.
Top
selig
Guru
Guru
User avatar
Posts: 425
Joined: Sun Jul 31, 2005 4:58 pm
Location: Prague, Czech Republic

  • Quote

Post by selig » Sun Jun 12, 2011 12:31 pm

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...
Top
mefyl
n00b
n00b
Posts: 3
Joined: Thu Nov 15, 2012 1:03 pm
Location: Paris

  • Quote

Post by mefyl » Thu Nov 15, 2012 1:16 pm

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: Select all

PORTAGE_RSYNC_EXTRA_OPTS="-4"
No need to hardcode an IP in your host file this way.

Cheers,
Top
rkfsm
Tux's lil' helper
Tux's lil' helper
Posts: 100
Joined: Fri Jun 03, 2005 2:54 pm
Location: Charleston, SC, USA

Me too

  • Quote

Post by rkfsm » Sat Mar 16, 2019 1:07 pm

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
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

  • Quote

Post by mike155 » Sat Mar 16, 2019 3:37 pm

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.
Top
Ant P.
Watchman
Watchman
Posts: 6920
Joined: Sat Apr 18, 2009 7:18 pm
Contact:
Contact Ant P.
Website

  • Quote

Post by Ant P. » Sun Mar 17, 2019 1:47 am

Dead mirrors should be reported as bugs, btw.
Top
krinn
Watchman
Watchman
User avatar
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

  • Quote

Post by krinn » Sun Mar 17, 2019 9:55 am

Ant P. wrote:Dead mirrors should be reported as bugs, btw.
not the case there

Code: Select all

Resolving gentoo.mirror.dkm.cz... 2001:470:1f0b:13d2::49, 86.49.49.49 

Code: Select all

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.
Top
saturnalia0
Apprentice
Apprentice
Posts: 173
Joined: Thu Oct 13, 2016 3:09 am

  • Quote

Post by saturnalia0 » Thu Sep 12, 2024 2:34 pm

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: Select all

echo 'filter-AAAA' >/etc/dnsmasq.conf
rc-service dnsmasq restart
From the manual:
--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: Select all

nameserver 127.0.0.1
nameserver your-dns-server-of-choice
In order to use dnsmaq. See also /etc/gai.conf.
Top
Post Reply

13 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic