dim icon indicating copy to clipboard operation
dim copied to clipboard

DIM allows invalid PTR records to be added

Open zeromind opened this issue 3 years ago • 1 comments

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 avatar Jun 13 '22 16:06 zeromind

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'
}

zeromind avatar Jun 13 '22 17:06 zeromind