Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 51f514f

Browse files
committedNov 4, 2020
DOT listens on all interfaces, refers to qdm12#281
1 parent cc9ae89 commit 51f514f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎internal/dns/conf.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func generateUnboundConf(ctx context.Context, settings settings.DNS,
6666
// Network
6767
"do-ip4": "yes",
6868
"do-ip6": doIPv6,
69-
"interface": "127.0.0.1",
69+
"interface": "0.0.0.0",
7070
"port": "53",
7171
// Other
7272
"username": "\"nonrootuser\"",

‎internal/dns/conf_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ server:
5454
harden-referral-path: yes
5555
hide-identity: yes
5656
hide-version: yes
57-
interface: 127.0.0.1
57+
interface: 0.0.0.0
5858
key-cache-size: 16m
5959
key-cache-slabs: 4
6060
msg-cache-size: 4m

‎internal/routing/reader.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (r *routing) VPNDestinationIP() (ip net.IP, err error) {
128128
for _, route := range routes {
129129
if route.LinkIndex == defaultLinkIndex &&
130130
route.Dst != nil &&
131-
!ipIsPrivate(route.Dst.IP) &&
131+
!IPIsPrivate(route.Dst.IP) &&
132132
bytes.Equal(route.Dst.Mask, net.IPMask{255, 255, 255, 255}) {
133133
return route.Dst.IP, nil
134134
}
@@ -156,7 +156,7 @@ func (r *routing) VPNLocalGatewayIP() (ip net.IP, err error) {
156156
return nil, fmt.Errorf("cannot find VPN local gateway IP address from ip routes")
157157
}
158158

159-
func ipIsPrivate(ip net.IP) bool {
159+
func IPIsPrivate(ip net.IP) bool {
160160
if ip.IsLoopback() || ip.IsLinkLocalUnicast() || ip.IsLinkLocalMulticast() {
161161
return true
162162
}

0 commit comments

Comments
 (0)
Please sign in to comment.