1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-12-26 12:59:24 +08:00

DNS: generator: loopback address support

This commit is contained in:
Neo_Chen 2020-04-26 19:49:55 +08:00
parent aefa55315d
commit 5b028f5b28
2 changed files with 55 additions and 22 deletions

View file

@ -9,15 +9,13 @@ $TTL 604800
; ;
@ IN NS NeoPDP-11.neo. @ IN NS NeoPDP-11.neo.
;
1.1 IN PTR NeoPDP-11.neo. 1.1 IN PTR NeoPDP-11.neo.
1.255 IN PTR NeoPDP-11.neo.
40.1 IN PTR cklvax.neo. 40.1 IN PTR cklvax.neo.
63.1 IN PTR NNPCC.neo. 63.1 IN PTR NNPCC.neo.
20.1 IN PTR NeoBOX.neo. 20.1 IN PTR NeoBOX.neo.
10.1 IN PTR neostorage.neonetwork. 10.1 IN PTR neostorage.neonetwork.
80.1 IN PTR NeoSystem.neo. 80.1 IN PTR NeoSystem.neo.
80.255 IN PTR NeoSystem.neo.
2.255 IN PTR ucbvax.neo.
1.3 IN PTR pan.neo. 1.3 IN PTR pan.neo.
185.8 IN PTR staph.neo. 185.8 IN PTR staph.neo.
@ -39,25 +37,14 @@ $TTL 604800
1.8 IN PTR librehs.neo. 1.8 IN PTR librehs.neo.
2.8 IN PTR blog.librehs.neo. 2.8 IN PTR blog.librehs.neo.
; DO NOT MANUALLY EDIT THE FOLLOWING LINES
; AUTOGENERATED ; AUTOGENERATED
; Tunnel /30 Addresses
1.0 IN PTR ucbvax.caasih.tun30.neo. 1.0 IN PTR ucbvax.caasih.tun30.neo.
2.0 IN PTR caasih.ucbvax.tun30.neo. 2.0 IN PTR caasih.ucbvax.tun30.neo.
9.0 IN PTR NeoSystem.ucbvax.tun30.neo. 9.0 IN PTR NeoSystem.ucbvax.tun30.neo.
10.0 IN PTR ucbvax.NeoSystem.tun30.neo. 10.0 IN PTR ucbvax.NeoSystem.tun30.neo.
10.127.10.1 IN PTR LanTian.pp.neo.
10.127.11.199 IN PTR SUNNET.pp.neo.
10.127.4.254 IN PTR Icecat-Explosion.pp.neo.
10.127.69.1 IN PTR santost12.pp.neo.
10.127.8.185 IN PTR staph.pp.neo.
10.127.8.193 IN PTR JerryXiao.pp.neo.
10.127.8.193 IN PTR JerryXiao.pp.neo.
10.127.8.193 IN PTR JerryXiao.pp.neo.
10.127.8.194 IN PTR JerryXiao-HK1.pp.neo.
10.127.8.194 IN PTR JerryXiao-HK1.pp.neo.
10.127.8.194 IN PTR JerryXiao-HK1.pp.neo.
10.127.8.195 IN PTR JerryXiao-SH1.pp.neo.
10.127.8.195 IN PTR JerryXiao-SH1.pp.neo.
10.127.8.196 IN PTR JerryXiao-HK2.pp.neo.
13.0 IN PTR NeoPDP-11.ucbvax.tun30.neo. 13.0 IN PTR NeoPDP-11.ucbvax.tun30.neo.
14.0 IN PTR ucbvax.NeoPDP-11.tun30.neo. 14.0 IN PTR ucbvax.NeoPDP-11.tun30.neo.
17.0 IN PTR NeoPDP-11.caasih.tun30.neo. 17.0 IN PTR NeoPDP-11.caasih.tun30.neo.
@ -118,5 +105,28 @@ $TTL 604800
138.0 IN PTR septs.James58899.tun30.neo. 138.0 IN PTR septs.James58899.tun30.neo.
141.0 IN PTR icecat-jp3.pan.tun30.neo. 141.0 IN PTR icecat-jp3.pan.tun30.neo.
142.0 IN PTR pan.icecat-jp3.tun30.neo. 142.0 IN PTR pan.icecat-jp3.tun30.neo.
172.20.51.99 IN PTR JerryXiao.pp.neo.
172.22.127.2 IN PTR dfceaef.pp.neo. ; Point to Point Addresses
1.10 IN PTR LanTian.pp.neo.
1.69 IN PTR santost12.pp.neo.
2.127 IN PTR dfceaef.pp.neo.
99.51 IN PTR JerryXiao.pp.neo.
185.8 IN PTR staph.pp.neo.
193.8 IN PTR JerryXiao.pp.neo.
193.8 IN PTR JerryXiao.pp.neo.
193.8 IN PTR JerryXiao.pp.neo.
194.8 IN PTR JerryXiao-HK1.pp.neo.
194.8 IN PTR JerryXiao-HK1.pp.neo.
194.8 IN PTR JerryXiao-HK1.pp.neo.
195.8 IN PTR JerryXiao-SH1.pp.neo.
195.8 IN PTR JerryXiao-SH1.pp.neo.
196.8 IN PTR JerryXiao-HK2.pp.neo.
199.11 IN PTR SUNNET.pp.neo.
254.4 IN PTR Icecat-Explosion.pp.neo.
; Loopback Addresses
1.255 IN PTR NeoPDP-11.neo
2.255 IN PTR ucbvax.neo
4.255 IN PTR pan.neo
56.255 IN PTR frank-hsinchu.neo
80.255 IN PTR NeoSystem.neo

View file

@ -3,6 +3,10 @@ set -e
IPTOOL="$PWD/Misc/C/ip" IPTOOL="$PWD/Misc/C/ip"
TUN30_TEMP="$(mktemp)"
PP_TEMP="$(mktemp)"
LO_TEMP="$(mktemp)"
if [ ! -x "$IPTOOL" ]; then if [ ! -x "$IPTOOL" ]; then
echo "You need to build Misc/C/ip first" echo "You need to build Misc/C/ip first"
exit 1 exit 1
@ -24,15 +28,34 @@ for i in *; do
upstream_ip=$("$IPTOOL" "$i" 1) upstream_ip=$("$IPTOOL" "$i" 1)
downstream_ip=$("$IPTOOL" "$i" 2) downstream_ip=$("$IPTOOL" "$i" 2)
(
print_record "$upstream_ip" "$DOWNSTREAM.$UPSTREAM.tun30.neo." print_record "$upstream_ip" "$DOWNSTREAM.$UPSTREAM.tun30.neo."
print_record "$downstream_ip" "$UPSTREAM.$DOWNSTREAM.tun30.neo." print_record "$downstream_ip" "$UPSTREAM.$DOWNSTREAM.tun30.neo."
) >> "$TUN30_TEMP"
elif [ "$TYPE" = "PP" ]; then elif [ "$TYPE" = "PP" ]; then
i="${i/PP,/}" i="${i/PP,/}"
upstream_ip="${i%~*}" upstream_ip="${i%~*}"
downstream_ip="${i#*~}" downstream_ip="${i#*~}"
print_record "$upstream_ip" "$UPSTREAM.pp.neo." (
print_record "$downstream_ip" "$DOWNSTREAM.pp.neo." print_record "$("$IPTOOL" "$upstream_ip" 0)" "$UPSTREAM.pp.neo."
print_record "$("$IPTOOL" "$downstream_ip" 0)" "$DOWNSTREAM.pp.neo."
) >> "$PP_TEMP"
elif [ "$TYPE" = "LO" ]; then
ip="${i/,32/}"
print_record "$("$IPTOOL" "$ip" 0)" "$NAME.neo" >> "$LO_TEMP"
fi fi
done done
) | sort -n >> dns/db.10.127 )
{
echo -e "\n; Tunnel /30 Addresses"
sort -n < "$TUN30_TEMP"
echo -e "\n; Point to Point Addresses"
sort -n < "$PP_TEMP"
echo -e "\n; Loopback Addresses"
sort -n < "$LO_TEMP"
} >> dns/db.10.127
rm -f "$TUN30_TEMP" "$PP_TEMP" "$LO_TEMP"