How to get "Name" from nslookup in Go?

Viewed 275

I see the following response when I run nslookup command from inside a pod running in a Kubernetes cluster.

root@ubuntu:/# nslookup kubernetes.default.svc
Server:     10.96.0.10
Address:    10.96.0.10#53

Name:   kubernetes.default.svc.cluster.local
Address: 10.96.0.1

How can I do the same in Go? It seems that Go has Lookup* methods which only return the IP address. But I want to know the domain name for which this response was returned. In fact, I am looking for a way to find the fully qualified domain name this way.

1 Answers
Related