Skip to content

Commit 9b5ae8c

Browse files
author
Kristan Kenney
committed
Initial commit: Add CAA records for DNS
1 parent fdeba40 commit 9b5ae8c

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

bin/v-add-dns-record

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,16 @@ if [[ $rtype =~ NS|CNAME|MX|PTR|SRV ]]; then
4545
fi
4646
fi
4747

48-
dvalue=${dvalue//\"/}
48+
if [ $rtype != "CAA" ]; then
49+
dvalue=${dvalue//\"/}
50+
# Exclude CAA records for ' enclosure
51+
if [[ "$dvalue" =~ [\;[:space:]] ]]; then
52+
dvalue='"'"$dvalue"'"'
53+
fi
54+
fi
4955

5056
if [[ "$dvalue" =~ [\;[:space:]] ]]; then
57+
dvalue=${dvalue//\"/}
5158
# Exclude SRV records for ' enclosure
5259
if [ "$rtype" != 'SRV' ]; then
5360
dvalue='"'"$dvalue"'"'

func/main.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ is_dbuser_format_valid() {
659659

660660
# DNS record type validator
661661
is_dns_type_format_valid() {
662-
known_dnstype='A,AAAA,NS,CNAME,MX,TXT,SRV,DNSKEY,KEY,IPSECKEY,PTR,SPF,TLSA'
662+
known_dnstype='A,AAAA,NS,CNAME,MX,TXT,SRV,DNSKEY,KEY,IPSECKEY,PTR,SPF,TLSA,CAA'
663663
if [ -z "$(echo $known_dnstype |grep -w $1)" ]; then
664664
check_result $E_INVALID "invalid dns record type format :: $1"
665665
fi

web/templates/admin/add_dns_rec.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
<option value="PTR" <?php if ($v_type == 'PTR') echo selected; ?>>PTR</option>
8383
<option value="SPF" <?php if ($v_type == 'SPF') echo selected; ?>>SPF</option>
8484
<option value="TLSA" <?php if ($v_type == 'TLSA') echo selected; ?>>TLSA</option>
85+
<option value="CAA" <?php if ($v_type == 'CAA') echo selected; ?>>CAA</option>
8586
</select>
8687
</td>
8788
</tr>

0 commit comments

Comments
 (0)