Created
April 1, 2022 14:46
-
-
Save prologic/2c3135df794129e13633230f294b8e09 to your computer and use it in GitHub Desktop.
Test program to test Go'a netdns=cgo resolver on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
) | |
func main() { | |
cnames, addrs, err := net.LookupSRV("_salty", "_tcp", "home.arpa") | |
if err != nil { | |
log.Fatal(err) | |
} | |
fmt.Printf("cnames: %s\n", cnames) | |
fmt.Printf("addrs: #%v\n", addrs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Build with:
Run with:
Note this is using my Mac's DNS server in /etc/resolv.conf
and not the Resolver in
/etc/resolver/home.arpa`:Expected output (using
dig
):