Documentation ¶
Overview ¶
Package opendnsmyip returns the public-facing IPv4 address of the requesting client by querying Cisco OpenDNS servers.
Example:
package main import ( "fmt" myip "github.com/johnsonjh/opendnsmyip" ) func main() { myIpAddr, err := myip.GetMyIP() if err != nil { fmt.Errorf("failure getting IP address: %s\n", err) } else { fmt.Printf("Public IPv4 address is: %s\n", myIpAddr) } }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMyIP ¶ added in v1.2.0
GetMyIP returns the public-facing IPv4 address of the caller client by querying the Cisco OpenDNS servers.
func MyIPDNSLookup ¶ added in v1.2.0
func MyIPDNSLookup( config dns.ClientConfig, client *dns.Client, message *dns.Msg, ) (string, error)
MyIPDNSLookup performs a DNS lookup using the "miekg/dns" package.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.