1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-06-02 14:03:04 +08:00
This commit is contained in:
edward-p 2020-12-18 15:28:47 +08:00
commit 3d432efde7
10 changed files with 119 additions and 82 deletions

2
asn/AS4242423618.toml Normal file
View file

@ -0,0 +1,2 @@
name = "Jerry AS"
owner = "JerryXiao"

View file

@ -10,19 +10,19 @@ $TTL 604800
@ IN NS NeoPDP-11.neo.
;
1.1 IN PTR NeoPDP-11.neo.
40.1 IN PTR cklvax.neo.
63.1 IN PTR NNPCC.neo.
20.1 IN PTR NeoBOX.neo.
10.1 IN PTR neostorage.neonetwork.
80.1 IN PTR NeoSystem.neo.
1.3 IN PTR pan.neo.
16.2 IN PTR caasih.neo.
127.2 IN PTR NeoRouter.neo.
1.1 IN PTR NeoPDP-11.neo.
40.1 IN PTR cklvax.neo.
63.1 IN PTR NNPCC.neo.
20.1 IN PTR NeoBOX.neo.
10.1 IN PTR neostorage.neonetwork.
80.1 IN PTR NeoSystem.neo.
1.3 IN PTR pan.neo.
16.2 IN PTR caasih.neo.
127.2 IN PTR NeoRouter.neo.
1.233 IN PTR liqingge.user-icecat.eth-ether5.cn.magicneko.neo.
1.234 IN PTR liqingge.user-icecat.eth-ether5.cn.magicneko.neo.
8.4 IN PTR koishi-v4.up-core.vtap-hentai-bb.hk.magicneko.neo.
8.4 IN PTR koishi-v4.up-core.vtap-hentai-bb.hk.magicneko.neo.
10.4 IN PTR luotianyi-v4.up.vtap-hentai-bb.hk.magicneko.neo.
15.4 IN PTR yuezhengling-v4.up.vtap-hentai-bb.jp.magicneko.neo.
@ -30,22 +30,30 @@ $TTL 604800
1.8 IN PTR librehs.neo.
2.8 IN PTR blog.librehs.neo.
; Loopback Addresses
1.255 IN PTR NeoPDP-11.neo.
4.255 IN PTR pan.neo.
18.255 IN PTR icecat-video.neo.
53.255 IN PTR root-dns.neo.
54.255 IN PTR dns.neo.
56.255 IN PTR frank-hsinchu-1.neo.
80.255 IN PTR NeoSystem.neo.
117.255 IN PTR magicneko-tw.neo.
; DELEGATED ZONES
9 IN NS ns1.jerry.neo.
12 IN NS ns1.yangfl.dn42.
NS ns2.yangfl.dn42.
7 IN NS ns1.staph.neo.
10 IN NS ns1.lantian.neo.
10 IN NS ns2.lantian.neo.
10 IN NS ns3.lantian.neo.
10 IN NS ns4.lantian.neo.
10 IN NS ns5.lantian.neo.
9 IN NS ns1.jerry.neo.
7 IN NS ns1.staph.neo.
10 IN NS ns1.lantian.neo.
10 IN NS ns2.lantian.neo.
10 IN NS ns3.lantian.neo.
10 IN NS ns4.lantian.neo.
10 IN NS ns5.lantian.neo.
11 IN NS ns1.sun.dn42.
; DO NOT MANUALLY EDIT THE FOLLOWING LINES
; AUTOGENERATED
; PLACEHOLDER
12 IN NS ns1.yangfl.dn42.
12 IN NS ns2.yangfl.dn42.

View file

@ -25,6 +25,10 @@ $TTL 604800
0.1.0.0.4.0.0.0.7.2.1.0.0.1.0.0.0.7.2.1.3.3.2.0 IN PTR luotianyi-v6.up.vtap-hentai-bb.hk.magicneko.neo.
5.1.0.0.4.0.0.0.7.2.1.0.0.1.0.0.0.7.2.1.3.3.2.0 IN PTR yuezhengling-v6.up.vtap-hentai-bb.jp.magicneko.neo.
; Loopback Addresses
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.3.5.0.0.f.f.f.f IN PTR root-dns.neo.
; DELEGATED ZONES
3.5.0.0 IN NS ns1.jerry.neo.

View file

@ -26,6 +26,10 @@ santost12 IN A 10.127.39.1
neko IN TXT "helloworld"
telegram IN TXT "https://t.me/NeoNetworkVPN"
root-dns IN A 10.127.255.53
root-dns IN AAAA fd10:127:ffff:53::
dns IN A 10.127.255.54
dns IN AAAA fd10:127:53:53::
; DELEGATED ZONES
jerry IN NS ns1.jerry

View file

@ -37,5 +37,5 @@ description = "For home devices internal network segment for testing connectivit
["10.127.255.18/32"]
type = "loopback"
name = "Video encoding node(Anycast)"
name = "icecat-video"
description = "Video encoding node, used to monitor (Cyan) online live broadcast in the live room and record encoding"

20
route/AS4242423618.toml Normal file
View file

@ -0,0 +1,20 @@
["10.127.255.53/32"]
type = "loopback"
name = "anycast-auth-4"
description = "Anycast authoritative DNS"
["10.127.255.54/32"]
type = "loopback"
name = "anycast-recur-4"
description = "Anycast recursive DNS"
["fd10:127:ffff:53::/64"]
type = "loopback"
name = "anycast-auth-6"
description = "Anycast authoritative DNS"
["fd10:127:53:53::/64"]
type = "loopback"
name = "anycast-recur-6"
description = "Anycast recursive DNS"
supernet = "fd10:127:53::/48"

25
scripts/check-named-zones.sh Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091
set -xeo pipefail
[ -n "$CI" ]
install() {
sudo DEBIAN_FRONTEND=noninteractive apt \
-o Dpkg::Options::=--force-confold \
install -y --no-install-recommends \
bind9-utils
}
install || { sudo apt update -qq; install; }
check() {
PATH=/sbin:/usr/sbin:$PATH named-checkzone -i local $@
}
pushd dns
check 'neo' neonetwork
check '127.10.in-addr.arpa' db.10.127
check '7.2.1.0.0.1.d.f.ip6.arpa' db.fd10.127
popd

29
scripts/dns-generator.py Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env python3
import sys
from pathlib import Path
import toml
from rfc2317 import gen_reverse_pointers
RESOLVE_FILE = Path("dns", "db.10.127")
RFC2317_FILE = Path("dns", "rfc2317.toml")
def iter_rfc2317_entry():
entries = toml.loads(RFC2317_FILE.read_text())
for (route, attributes) in entries.items():
ns = attributes.get('ns')
yield(route, ns)
def main():
orignal = RESOLVE_FILE.read_text()
records = [orignal, "; AUTOGENERATED"]
records.extend(("", "; rfc2317"))
for route, ns in iter_rfc2317_entry():
records.extend(gen_reverse_pointers(route, ns))
records.append("")
RESOLVE_FILE.write_text("\n".join(records))
if __name__ == "__main__":
main()

View file

@ -1,57 +0,0 @@
#!/usr/bin/env python3
import sys
from ipaddress import IPv4Address, ip_network, IPv4Network
from pathlib import Path
import toml
from rfc2317 import gen_reverse_pointers
RESOLVE_FILE = Path("dns", "db.10.127")
ROUTE_FILE = Path("route")
RFC2317_FILE = Path("dns", "rfc2317.toml")
def iter_route(route_type: str):
items = []
for f in ROUTE_FILE.iterdir():
routes = toml.loads(f.read_text())
items.extend(
(entity["name"], ip_network(route).network_address)
for route, entity in routes.items()
if entity["type"] == route_type and isinstance(ip_network(route), IPv4Network)
)
routes = []
remove = []
for item in items[::-1]:
if item[1] in routes:
remove.append(item)
else:
routes.append(item[1])
for i in remove:
items.remove(i)
return sorted(items, key=lambda item: item[1])
def iter_rfc2317_entry():
entries = toml.loads(RFC2317_FILE.read_text())
for (route, attributes) in entries.items():
ns = attributes.get('ns')
yield(route, ns)
def main():
orignal = RESOLVE_FILE.read_text()
orignal = orignal[: orignal.find("\n; AUTOGENERATED")]
records = [orignal, "; AUTOGENERATED", "", "; Loopback Addresses"]
for name, address in iter_route("loopback"):
if isinstance(address, IPv4Address):
pointer = address.reverse_pointer.replace(".127.10.in-addr.arpa", "")
records.append("%s\tIN\tPTR\t%s.neo." % (pointer, name))
records.extend(("", "; rfc2317"))
for route, ns in iter_rfc2317_entry():
records.extend(gen_reverse_pointers(route, ns))
records.append("")
RESOLVE_FILE.write_text("\n".join(records))
if __name__ == "__main__":
main()

View file

@ -11,7 +11,7 @@ export MAX_LEN_6=64
mkdir -p generated
mkdir -p generated/dns
scripts/dns-reverse-generator.py
scripts/dns-generator.py
cp -R dns/* generated/dns
scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -o generated/roa46_bird2.conf
@ -21,3 +21,5 @@ scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -j -o generated/roa46.json
scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -e -o generated/neonetwork.json
scripts/roa.py -m "$MAX_LEN_4" -M "$MAX_LEN_6" -r -o generated/rfc8416.json
scripts/roa.py --summary --output generated/README.md
scripts/check-named-zones.sh