DOT listens on all interfaces, refers to #281
This commit is contained in:
@@ -66,7 +66,7 @@ func generateUnboundConf(ctx context.Context, settings settings.DNS,
|
|||||||
// Network
|
// Network
|
||||||
"do-ip4": "yes",
|
"do-ip4": "yes",
|
||||||
"do-ip6": doIPv6,
|
"do-ip6": doIPv6,
|
||||||
"interface": "127.0.0.1",
|
"interface": "0.0.0.0",
|
||||||
"port": "53",
|
"port": "53",
|
||||||
// Other
|
// Other
|
||||||
"username": "\"nonrootuser\"",
|
"username": "\"nonrootuser\"",
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ server:
|
|||||||
harden-referral-path: yes
|
harden-referral-path: yes
|
||||||
hide-identity: yes
|
hide-identity: yes
|
||||||
hide-version: yes
|
hide-version: yes
|
||||||
interface: 127.0.0.1
|
interface: 0.0.0.0
|
||||||
key-cache-size: 16m
|
key-cache-size: 16m
|
||||||
key-cache-slabs: 4
|
key-cache-slabs: 4
|
||||||
msg-cache-size: 4m
|
msg-cache-size: 4m
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ func (r *routing) VPNDestinationIP() (ip net.IP, err error) {
|
|||||||
for _, route := range routes {
|
for _, route := range routes {
|
||||||
if route.LinkIndex == defaultLinkIndex &&
|
if route.LinkIndex == defaultLinkIndex &&
|
||||||
route.Dst != nil &&
|
route.Dst != nil &&
|
||||||
!ipIsPrivate(route.Dst.IP) &&
|
!IPIsPrivate(route.Dst.IP) &&
|
||||||
bytes.Equal(route.Dst.Mask, net.IPMask{255, 255, 255, 255}) {
|
bytes.Equal(route.Dst.Mask, net.IPMask{255, 255, 255, 255}) {
|
||||||
return route.Dst.IP, nil
|
return route.Dst.IP, nil
|
||||||
}
|
}
|
||||||
@@ -156,7 +156,7 @@ func (r *routing) VPNLocalGatewayIP() (ip net.IP, err error) {
|
|||||||
return nil, fmt.Errorf("cannot find VPN local gateway IP address from ip routes")
|
return nil, fmt.Errorf("cannot find VPN local gateway IP address from ip routes")
|
||||||
}
|
}
|
||||||
|
|
||||||
func ipIsPrivate(ip net.IP) bool {
|
func IPIsPrivate(ip net.IP) bool {
|
||||||
if ip.IsLoopback() || ip.IsLinkLocalUnicast() || ip.IsLinkLocalMulticast() {
|
if ip.IsLoopback() || ip.IsLinkLocalUnicast() || ip.IsLinkLocalMulticast() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user