Skip to content

Commit fb591d7

Browse files
authored
Add DHCID record type (#167)
These changes add support for importing bind9 zone files that contain DHCID records [1], as well as validation of DHCID entries in the zone.php template. [1] https://tools.ietf.org/html/rfc4701
1 parent 869b64f commit fb591d7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

bindzonefile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function parse_into_rrsets(Zone $zone, $comment_handling) {
4343
$line_number = 0;
4444
$new_rrsets = array();
4545
$new_rrset_comments = array();
46-
$recordtypes = 'A|AAAA|ALIAS|CAA|CNAME|LOC|MX|NAPTR|NS|PTR|SOA|SRV|SSHFP|TXT';
46+
$recordtypes = 'A|AAAA|ALIAS|CAA|CNAME|DHCID|LOC|MX|NAPTR|NS|PTR|SOA|SRV|SSHFP|TXT';
4747
$mainregexp = '/^
4848
(;)? # Starting semicolon, indicating commented-out (disabled) record
4949
(?:\s+|(\S+)\s+) # Record name, or whitespace to use same name as previous line

templates/zone.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@
172172
<option value="ALIAS" data-content-pattern="\S+">ALIAS</option>
173173
<option value="CAA" data-content-pattern="[0-9]+\s+\S+\s+\S+">CAA</option>
174174
<option value="CNAME" data-content-pattern="\S+">CNAME</option>
175+
<!-- DHCID regex contributed under CC BY-SA 4.0 by njzk2 (https://stackoverflow.com/users/671543/njzk2) on Stack Overflow: https://stackoverflow.com/a/5885097 -->
176+
<option value="DHCID" data-content-pattern="^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$">DHCID</option>
175177
<option value="DNAME" data-content-pattern="\S+">DNAME</option>
176178
<option value="DNSKEY" data-content-pattern="[0-9]+\s+[0-9]+\s+[0-9]+\s+.+">DNSKEY</option>
177179
<option value="DS" data-content-pattern="[0-9]+\s+[0-9]+\s+[0-9]+\s+[a-zA-Z0-9]+">DS</option>

0 commit comments

Comments
 (0)