Prefix / Subnet instead of ARPA

Discussion in 'Feature Requests' started by remkoh, Jun 24, 2024.

Tags:
  1. remkoh

    remkoh Active Member

    Especially IPv6 reverse DNS names can become way long, which makes them almost unreadable in the DNS overview.

    It would help inmensly to translate them to the prefix and prefix length in the DNS overview.

    Some examples:
    Code:
    8.7.6.5.4.3.2.1.ip6.arpa
    b.a.0.9.8.7.6.5.4.3.2.1.ip6.arpa
    e.d.c.b.a.0.9.8.7.6.5.4.3.2.1.ip6.arpa
    f.e.d.c.b.a.0.9.8.7.6.5.4.3.2.1.ip6.arpa
    c.a.8.6.4.2.f.e.d.c.b.a.0.9.8.7.6.5.4.3.2.1.ip6.arpa
    c.a.0.0.8.6.4.2.f.e.d.c.b.a.0.9.8.7.6.5.4.3.2.1.ip6.arpa
    
    as prefix and prefix length
    Code:
    1234:5678::/32
    1234:5678:90ab::/48
    1234:5678:90ab:cde0::/60
    1234:5678:90ab:cdef::/64
    1234:5678:90ab:cdef:2468:ac00::/88
    1234:5678:90ab:cdef:2468:ac::/96
    
    Webmin's inbuild Bind module does the same.

    Every slot is prefix length +4, starting at 4.
    So it should be fairly easy to calculate and rewrite.
    Just start counting from the back (in front of .ip6.arpa) to the front and combine per 4 seperated by : and finish with ::/<calculated prefix length>
    If the last (leftover) part is less than 4 then zero's should be added until 4 is reached.
    Zero's at the start of every part can be forgotten (unless all 4 are zero's, then just one).

    Pretty much the same flies for IPv4, though they don't grow that long and are much easier to translate.

    Some examples:
    Code:
    3.2.1.in-addr.arpa
    2.1.in-addr.arpa
    1.in-addr.arpa
    
    as subnet
    Code:
    1.2.3.0/24
    1.2.0.0/16
    1.0.0.0/8
    
    (Webmin's Bind module only displays 1.2.3, 1.2 and 1)
     
    Last edited: Jun 25, 2024
    ahrasis likes this.

Share This Page