go language better and better - Network [3] -IPAddr

IPAddr

{IPAddr of the type
IP IP
}
The main purpose is to find this type of IP hostname perform DNS.

image.png

image.png

image.png

test

image.png

ResolveIPAddr function will perform DNS host name lookup, and returns a single IP address.
However, the host may have multiple IP addresses, often from multiple network cards. They may also have multiple host names, act as an alias.

image.png

Wherein an address is marked as "specification (Canonical)" hostname. If you want to find a canonical name, please use.

image.png

image.png

image.png

Test 2

image.png

      go-verbal communication, group 2: 713 385 260

image.png

Guess you like

Origin blog.51cto.com/13784902/2465669