Oracle Linux: How to prioritize IPv4 resolution over IPv6 resolution in a dual-stack environment
in Linux
Applies To:
Oracle Cloud Infrastructure
Linux x86-64
Goal:
This document describes how to prioritize IPv4 address resolution over IPv6 address resolution in a dual-stack environment.
Solution:
For applications that are calling getaddrinfo()
to resolve host names or service names, it is possible that getaddrinfo()
can return multiple answers. According to RFC 3484 these answers must be sorted so that the answer with the highest success rate is first in the list.
To prefer IPv4 address resolution over IPv6 resolution in a dual-stack environment, one can create and edit /etc/gai.conf
to define rules.
Here is an example.
- Create/edit
Tagged:
0