Go program to find Name Server (NS) record of a domain
The NS records describe the authorized name servers for the zone. The NS also delegates subdomains to other organizations on zone files. The net.LookupNS() function takes a domain name(facebook.com) as a string and returns DNS-NS records as a slice of NS structs.
Example
package main
import (
"fmt"
"net"
)
func main() {
nameserver, _ := net.LookupNS("facebook.com")
for _, ns := range nameserver {
fmt.Println(ns)
}
}
&{a.ns.facebook.com.} &{b.ns.facebook.com.}
Most Helpful This Week
Golang HTTP GET request with parameters
React JS Count number of checkboxes are checked
How do you handle HTTP server health checks in Go?
Convert Int data type to Int16 Int32 Int64
Make Your Retirement Luxurious with These 5 Game-Changing Altcoins
Top 20 Most Popular Cryptocurrencies To Watch In 2024
What is risk management and why is it important?
How to create Slice using new keyword in Golang?
Golang program for implementation of Merge Sort
Golang Program to print Triangle of Numbers