Skip to content

Commit

Permalink
Static IP configuration for openDNS to avoid v4 lookups via v6 namese…
Browse files Browse the repository at this point in the history
…rver
  • Loading branch information
dschanoeh committed Nov 21, 2021
1 parent f54dbd9 commit 90e069e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions publicip/opendns.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
)

const (
dnsServer = "resolver1.opendns.com:53"
dnsServerV6 = "resolver1.ipv6-sandbox.opendns.com:53"
dnsServer = "208.67.222.222:53" // resolver1.opendns.com
dnsServerV6 = "[2620:119:35::35]:53" // resolver1.opendns.com
dnsTarget = "myip.opendns.com"
)

Expand Down Expand Up @@ -40,7 +40,7 @@ func (r *OpenDNSLookupProvider) GetPublicIP() (net.IP, error) {
}

if len(res.Answer) == 0 {
return nil, errors.New("Didn't get any results for the query")
return nil, errors.New("didn't get any results for the query")
}

for _, ans := range res.Answer {
Expand All @@ -60,7 +60,7 @@ func (r *OpenDNSLookupProvider) GetPublicIPv6() (net.IP, error) {
}

if len(res.Answer) == 0 {
return nil, errors.New("Didn't get any results for the query")
return nil, errors.New("didn't get any results for the query")
}

for _, ans := range res.Answer {
Expand Down

0 comments on commit 90e069e

Please sign in to comment.