📖Ip

Linux

Configuration

Prefer IPv4

Arch

To prioritize IPv4 over IPv6 on Arch Linux without breaking network services, you should modify the address precedence configuration in /etc/gai.conf. This forces your system's getaddrinfo resolution to list IPv4 addresses ahead of IPv6 for all standard applications.

You can accomplish this using the following concrete steps:

  1. Open /etc/gai.conf in your terminal with your preferred text editor (e.g., sudo nano /etc/gai.conf).

  2. Add or uncomment the following line to give IPv4 traffic the highest priority:

    • precedence ::ffff:0:0/96 100

  3. Save the file and exit. No service or system restart is required.