How to change default dnf server country

I am trying to figure out how to change the default country server used by dnf. I have searched a lot online but have not come up with a solution. Thanks

1 Like

By default, the metalink redirects you to an appropriate mirror. You can specify individual mirrors, but I do not think you can specify countries. To use a specific mirror, get its URL from here:

and modify the repository file in /etc/yum.repos.d to use this URL in the baseurl=.. field, and comment out the metalink=.. line by adding a # at its start.


There’s a load balancer between mirrors having exactly the same contents except a few hours for the information to get to target. Changing mirrors won’t get you anywhere except losing time as slower … use system thinking to grasp a global vision.

Thanks for you reply. Instead of commenting out “metalink” as you say, couldn’t I add “country=xy” to it and solve my problem?

I was trying to find a global solution, but maybe Fedora requires a manual and per case entry for server country?

I have experienced that some countries have much faster servers than others. It is not a question of different mirrors in the same country, but a different country altogether.

You can tell dnf to always check and use the fastest mirror by editing /etc/dnf/dnf.conf and adding a line that says fastestmirror=True

Thanks but I am not looking for fastest mirror. I am looking to change country of server.

I don’t see any mention of this in the docs, so I don’t think so.

I expect one can generate metalink data on a per country basis, but the Fedora community doesn’t do this because it is not required by us. You may be able to do it yourself I guess, but I wouldn’t know where to start.

I saw some suggestions online that adding “country=xy” would change server country, but it seems a bit of a messy solution. It’s just that some countries have slow servers and others much faster. Any thanks for your time.

In fact country=XX is a valid parameter.

For example , the mirrorslist obtained by the command curl "" contains only the US mirror server