How To Choose a Specific IP Address From a DNS Result?

Photo by Jordan Harrison on Unsplash,,,,,
scopev4 ::ffff: 3
scopev4 ::ffff: 2
scopev4 ::ffff: 1

Second column is the IP subnet, third column is the priority. The lower number has high priority.

1) Call getaddrinfo
2) Get IP address of
3) Check if there is a rule for these IP addresses in the gai.conf file
4) Get the one that has high priority. If an IP address of is not listed in gai.conf and getaddrinfo would return that IP.
root@adil:~# systemd-resolve --flush-caches && ping -c1PING ( 56(84) bytes of data.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

CG Pipeline: In-House Development vs Commercial Solution

dClimate Tech Update

Denormalized indexing with elasticsearch-rails

After Agile: The Asynchronous Future

7 things any Java developer should know when starting with Kotlin

[008]Reverse String 344 反轉字串

A Decade with Distributed Systems — My Experience

How to make a simple HTTP server using python?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


More from Medium

Zabbix Upgrade 4.4 to 5.0 using Centos 8

Start a VMware vSphere Virtual Machine — Ansible module vmware_guest_powerstate

Linux Command -Line Warmup !!

LVM in Linux — Create and Extend a Logical Volume