Skip to content

Instantly share code, notes, and snippets.

@bonedaddy
Created March 23, 2020 00:12
Show Gist options
  • Save bonedaddy/1f2c2104b7a21e340ffe6851f6b8ec11 to your computer and use it in GitHub Desktop.
Save bonedaddy/1f2c2104b7a21e340ffe6851f6b8ec11 to your computer and use it in GitHub Desktop.
dns.7qiao.cn:5356 {
file db.dns.7qiao.cn
# only allow access to this record from nebula
acl lighthouse1.dns.7qiao.cn {
allow net 172.30.0.0/16
block
}
# only allow access to this record from nebula
acl lighthouse2.dns.7qiao.cn {
allow net 172.30.0.0/16
block
}
log
errors
}
.:5356 {
chaos 7qiao [email protected]
forward . 8.8.8.8 8.8.4.4 9.9.9.9
log
errors
whoami
health # only need to enable this once
cache
}
dns.7qiao.cn:5356 {
file db.dns.7qiao.cn
# only allow access to this record from nebula
acl lighthouse1.dns.7qiao.cn {
allow net 172.30.0.0/16
block
}
# only allow access to this record from nebula
acl lighthouse2.dns.7qiao.cn {
allow net 172.30.0.0/16
block
}
log
errors
}
172.30.0.0/16:5356 {
file db.dns.7qiao.cn
# only allow access to this record from nebula
acl lighthouse1.dns.7qiao.cn {
allow net 172.30.0.0/16
block
}
# only allow access to this record from nebula
acl lighthouse2.dns.7qiao.cn {
allow net 172.30.0.0/16
block
}
template IN A dns.7qiao.cn {
match (^|[.])ip-(?P<a>[0-9]*)-(?P<b>[0-9]*)-(?P<c>[0-9]*)-(?P<d>[0-9]*)[.]dns.7qiao.cn[.]$
answer "{{ .Name }} 60 IN A {{ .Group.a }}.{{ .Group.b }}.{{ .Group.c }}.{{ .Group.d }}"
fallthrough
}
template IN PTR in-addr.arpa {
match ^(?P<d>[0-9]*)[.](?P<c>[0-9]*)[.](?P<b>[0-9]*)[.](?P<a>[0-9]*)[.]in-addr[.]arpa[.]$
answer "{{ .Name }} 60 IN PTR ip-{{ .Group.a }}-{{ .Group.b }}-{{ .Group.c }}-{{ .Group.d }}.dns.7qiao.cn."
}
log
errors
}
.:5356 {
chaos 7qiao [email protected]
forward . 8.8.8.8 8.8.4.4 9.9.9.9
log
errors
whoami
health # only need to enable this once
cache
}
$ORIGIN dns.7qiao.cn. ; this symbol starts a comment
$TTL 3600 ; this sets the default ttl
@ IN SOA ns1.dns.7qiao.cn. [email protected] (
2020032202 ; serial - RFC-1912 format
7200 ; time to refresh (2 hours)
3600 ; time to retry (1 hour)
1209600 ; time to expire (2 weeks)
3600 ; minimum ttl (1 hour)
)
3600 IN NS ns1.dns.7qiao.cn.
3600 IN NS ns2.dns.7qiao.cn.
; public internet records denotes records for resources accessible from the internet
www IN A 127.0.0.1
lighthouse1-ext IN A 59.39.177.19
lighthouse2-ext IN A 59.39.177.18
; nebula records denotes records for the nebula overlay network
lighthouse1 IN A 172.30.0.1
lighthouse2 IN A 172.30.0.2
ns1 IN CNAME lighthouse1-ext
ns2 IN CNAME lighthouse2-ext
gray IN A 172.30.255.254
test IN A 127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment