Can dnf try EVERY mirror before failing?

Is there a way to tell dnf to try every mirror, and perhaps every IP address of every mirror before it gives up?

I’ve noticed several times that times out. I tracked it down to them using multiple A records and AAAA records in dns and sometimes one of their servers is down. I’d assume that dnf would retry multiple times before failing but I don’t think it does. Or I’m just really unlucky…

either way, i’d like dnf to try harder before erroring out. How do i configure that?

1 Like

I am not sure exactly how it would be set up, but if you use man dnf.conf it gives you a lot of info on the available options that can be placed in /etc/dnf/dnf.conf and what they do. I would suspect there is where you may need to configure it if what you ask is possible.

Just as an aside. I have noted that sometimes if my system has IPv6 enabled I see timeouts on dns lookups but if I have only IPv4 enabled I do not see the timeouts. You may want to consider that and try disabling IPv6 before you jump down that rabbit hole with the mirrors. IPv6 can be disabled with the settings → network control panel and if it makes no difference it can be re-enabled the same way.

BTW, this seems to be a continuation of the same topic here.
It is strongly encouraged that you not post duplicate threads on the same topic.


It is not.

They are two different issues. One is that a fedora project mirror seems to be down right now.

The other is that dnf is handling that very poorly.

Both need to be solved, and the same solution will not fix both problems, hence seperate threads.

you don’t have to reply then. I’ll reply with the instructions myself when I figure it out, to create searchable content on this site that will help others and probably myself too when I forget it and need to figure it out again.

okay. That’s a root cause that needs fixing.

Its 2022. Disabling ipv6 is not how you solve a problem. neither is disabling selinux. or the firewall. nor chmod 777 -R /. Put down the shotgun.

My problem is not rooted in dns timeouts. As stated:

That means two of the servers are actually not responding to tcp connections on port 80 right now. That is not a dns problem. I’ll list them on the other thread because that’s not what this one is about.

This thread is about configuring DNF to be more resilient to a mirror not responding.

:thinking: I noticed sometime when I upgrade the system it will changes the mirror automatically. I can see it move from my home country Indonesia to Japan or China server and it’s with default settings.


When I open /etc/yum.repos.d/fedora-updates.repo file on [updates] part there a line of:


I change the link to check the available mirror to my machine and open it from browser:

# Open on browser

then I get the metalink file that contain list of mirror available for my system:

<resources maxconnections="1">
    <url protocol="rsync" type="rsync" location="ID" preference="100">rsync://</url>
    <url protocol="http" type="http" location="ID" preference="100"></url>
    <url protocol="http" type="http" location="JP" preference="99"></url>
    <url protocol="rsync" type="rsync" location="JP" preference="99">rsync://</url>
    <url protocol="https" type="https" location="JP" preference="99"></url>
    <url protocol="http" type="http" location="JP" preference="98"></url>
    <url protocol="rsync" type="rsync" location="JP" preference="98">rsync://</url>
    <url protocol="http" type="http" location="TH" preference="97"></url>
    <url protocol="rsync" type="rsync" location="TH" preference="97">rsync://</url>
    <url protocol="https" type="https" location="CN" preference="96"></url>
    <url protocol="http" type="http" location="CN" preference="96"></url>
    <url protocol="rsync" type="rsync" location="CN" preference="96">rsync://</url>
    <url protocol="https" type="https" location="JP" preference="95"></url>
    <url protocol="http" type="http" location="JP" preference="95"></url>
    <url protocol="rsync" type="rsync" location="JP" preference="95">rsync://</url>
    <url protocol="http" type="http" location="JP" preference="94"></url>
    <url protocol="rsync" type="rsync" location="JP" preference="94">rsync://</url>
    <url protocol="https" type="https" location="SG" preference="93"></url>
    <url protocol="http" type="http" location="SG" preference="93"></url>
    <url protocol="rsync" type="rsync" location="SG" preference="93">rsync://</url>
    <url protocol="rsync" type="rsync" location="CN" preference="92">rsync://</url>
    <url protocol="http" type="http" location="CN" preference="92"></url>
    <url protocol="rsync" type="rsync" location="CN" preference="91">rsync://</url>
    <url protocol="https" type="https" location="CN" preference="91"></url>

May be you want to try it too then check for each servers (they are all mostly volunteering) why they not responding.


I tried to ping SERVER_ADDRESS -n4 for IP4 then ping SERVER_ADDRESS -n6 for IP6, and found it only works with IP4.

I check further from free web services to check IPv6:

I guess my country living in the past since it’s not able to use IPv6. :sweat_smile:

You could also check with online available service to ping the server if it support IPv6 or not.

For example bellow are ping to Google:

And bellow ping to nearest server to me and look like they have not support for IPv6:


But it’s ok. The owner look like a good gentleman since he hosted lot of Linux Distros mirror update.

Another update:

Since from other post look like you have server that able to connect to IPv6, may be if you have extra spaces and bandwidths, you could also volunteering to host Fedora Linux update with IPv6. That would be awesome.

:clap: :clap: :clap: :clap: :clap:

That is the problem. That domain resolves to multiple v4 and v6 ips. Two of them are down. your web browser is smart enough to keep trying until it finds one that is up. DNF is not.

How about the epel-7 repo, could not be that the culprit for the time-out?
The epel repo is not on every mirror …

You also need to remember that for each mirror it tries, dnf must wait for the timeout before it will switch to the next mirror. If it starts through a list where more than one fail to respond in a row that adds dramatically to the time-out delays.

If you are convinced that this is actually a dnf issue then please take the necessary action and report it as a bug so you can get a definitive answer from the developers. and log in with the same credentials you use here.

Continuing to thrash this out in a discussion forum seems to not move toward an answer that you will be satisfied with.

for each mirror in the list it gets from the metalink, right?

As I understand it dnf gets the list from the metalink, then picks one to start and from that point it walks the list if the first one fails. For each one it tries there is a time out delay before it decides it needs to switch to another.

The delay seems to be predicated on slow data transfer as well as non-reply as the case occurs.

And what’s it do if the metalink is down? That is what was happening intermittantly.

The metalink is awfully important right? so it’s hosted on multiple servers across the world. The metalink is hosted on and that domain has a dozen or more IPs that host it.

The hostname in DNS has multiple A and AAAA records. And when dnf fetches the metalink via libcurl or whatever, the local resolver picks one at random for it to follow. If that one is the one that’s down, dnf throws an error.

You can sett up in /etc/dnf/dnf.conf to speed up the process.


This settings helped me to speed up my process of upgrade.