1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Fix NAPTR record support.

This commit is contained in:
Peter Dunaskin
2019-03-29 12:01:52 +01:00
parent 7566c0428e
commit e2726dda64
7 changed files with 13 additions and 13 deletions

View File

@ -82,7 +82,7 @@ type RecordConfig struct {
NaptrService string `json:"naptrservice,omitempty"`
NaptrRegexp string `json:"naptrregexp,omitempty"`
//NaptrReplacement string `json:"naptrreplacement,omitempty"`
NaptrReplacement string `json:"target"`
//NaptrReplacement string `json:"target"`
SshfpAlgorithm uint8 `json:"sshfpalgorithm,omitempty"`
SshfpFingerprint uint8 `json:"sshfpfingerprint,omitempty"`
TlsaUsage uint8 `json:"tlsausage,omitempty"`
@ -215,8 +215,7 @@ func (rc *RecordConfig) ToRR() dns.RR {
rr.(*dns.NAPTR).Flags = rc.NaptrFlags
rr.(*dns.NAPTR).Service = rc.NaptrService
rr.(*dns.NAPTR).Regexp = rc.NaptrRegexp
//rr.(*dns.NAPTR).Replacement = rc.GetTargetField()
rr.(*dns.NAPTR).Replacement = rc.NaptrReplacement
rr.(*dns.NAPTR).Replacement = rc.GetTargetField()
case dns.TypeMX:
rr.(*dns.MX).Preference = rc.MxPreference
rr.(*dns.MX).Mx = rc.GetTargetField()
@ -316,10 +315,10 @@ func downcase(recs []*RecordConfig) {
r.Name = strings.ToLower(r.Name)
r.NameFQDN = strings.ToLower(r.NameFQDN)
switch r.Type { // #rtype_variations
case "ANAME", "CNAME", "MX", "NS", "PTR", "NAPTR", "SRV":
case "ANAME", "CNAME", "MX", "NS", "PTR", "SRV":
// These record types have a target that is case insensitive, so we downcase it.
r.Target = strings.ToLower(r.Target)
case "A", "AAAA", "ALIAS", "CAA", "IMPORT_TRANSFORM", "TLSA", "TXT", "SOA", "SSHFP", "CF_REDIRECT", "CF_TEMP_REDIRECT":
case "A", "AAAA", "ALIAS", "CAA", "IMPORT_TRANSFORM", "NAPTR", "TLSA", "TXT", "SOA", "SSHFP", "CF_REDIRECT", "CF_TEMP_REDIRECT":
// These record types have a target that is case sensitive, or is an IP address. We leave them alone.
// Do nothing.
default: