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

DIM allows invalid PTR records to be added #251

Open
zeromind opened this issue Jun 13, 2022 · 1 comment
Open

DIM allows invalid PTR records to be added #251

zeromind opened this issue Jun 13, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@zeromind
Copy link
Collaborator

DIM currently allows invalid PTR records to be added, for example:
rr_create(ip='12.0.0.1', type='PTR', views=['default'], ptrdname='z.test.com.', name='12.0.0.1.0.0.12.in-addr.arpa.', comment='')
results in

{
  'layer3domain': 'default',
  'record': '12.0.0.1',
  'ttl': None,
  'type': 'PTR',
  'value': 'a.test.com.',
  'view': 'default',
  'zone': '0.0.12.in-addr.arpa'
}

see https://datatracker.ietf.org/doc/html/rfc1035#section-3.5

Domain names in the IN-ADDR.ARPA domain are defined to have up to four
labels in addition to the IN-ADDR.ARPA suffix. Each label represents
one octet of an Internet address, and is expressed as a character string
for a decimal value in the range 0-255 (with leading zeros omitted
except in the case of a zero octet which is represented by a single
zero).

@zeromind zeromind added the bug Something isn't working label Jun 13, 2022
@zeromind
Copy link
Collaborator Author

Additionally, rr_create(ip='12.0.0.2', type='PTR', views=['default'], ptrdname='b.test.com.', name='0.0.12.in-addr.arpa.', comment='')
results in

{
 'layer3domain': 'default',
 'record': '@',
 'ttl': None,
 'type': 'PTR',
 'value': 'b.test.com.',
 'view': 'default',
 'zone': '0.0.12.in-addr.arpa'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant