You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Oracle Linux: How to prioritize IPv4 resolution over IPv6 resolution in a dual-stack environment

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

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!