Go program to find Forward(A) record of a domain

The net.LookupIP() function accepts a string(domain-name) and returns a slice of net.IP objects that contains host's IPv4 and IPv6 addresses.


package main
import (
func main() {
	iprecords, _ := net.LookupIP("facebook.com")
	for _, ip := range iprecords {

The output of above program lists the A records for facebook.com that were returned in IPv4 and IPv6 formats.

Most Helpful This Week