Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's already a reverse_dns property for IPAddresses, but a rfc4183 property on IPSubnets would be great. (For IP's in cidr blocks.) #165

Open
dragonpaw opened this issue Nov 13, 2017 · 3 comments

Comments

@dragonpaw
Copy link

Something akin to:

def rfc4183(self)
    l = str(self.cidr).split('.')
    l.reverse()
    l[0] = l[0].replace('/', '-')
    in_addr = '.'.join((str(self.ip.words[-1]), *l, 'in-addr.arpa'))
@jstasiak
Copy link
Contributor

@dragonpaw I know this is an old report, but if you remember what is it about – can you give an example of what you need here?

@dragonpaw
Copy link
Author

dragonpaw commented Mar 24, 2021

Long time indeed...

Ok, so RFC 4183 is about how to handle reverse DNS delegation that isn't on an octet boundary. (Looking it over briefly will probably help explain why I'd asked for this.)

From the RFC there's an example of what happens when a customer gets given 10.100.2.0/26 as their subnet assignment and wants to do reverse dns themselves for it. Since they don't have a full /24, they can't do the old-school way of running a dns server for 2.100.20.in-addr.arpa. So instead, the ISP sets up a reverse DNS delegation for a domain 0-26.2.100.10.in-addr.arpa. (Note the first part is 0-26, which is the first ip in the range, then the /size of the subnet.) If the ISP has 3 other customers sharing 10.100.2 they would have other delegations such as 64-26, 128-26, and 192-26.

Now, within that I ran the DNS zone for 0-24.2.100.10-in-addr.arpa, and had reverse entries for:

1.0-24.2.100.10.in-addr.arpa PTR host1.example.com
2.0-24.2.100.10.in-addr.arpa PTR host2.example.com
...
62.0-24.2.100.10.in-addr.arpa PTR host63.example.com

Now, I'm not entirely sure how many people really care to setup reverse DNS any more, or how many people buy subnets worth of IPs to do it with, but back in 2017 at least, this was the RFC that the ISP I was working with was following for how to do those. Hence my request was for a little helper to take IPSubnet and have it cough up the correct domain that would correspond.

@jstasiak
Copy link
Contributor

Ah, nice, thank you for the thorough explanation. This seems appropriate to have, a pull request implementing it with some tests etc. would be nice (I don't have resources to do it myself).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants