mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
NS1: Add SRV record support (#277)
* NS1 SRV record support * Updated feature matrix
This commit is contained in:
committed by
Tom Limoncelli
parent
53b72f39a8
commit
f5bfcd0d6e
@ -115,7 +115,7 @@ var tmpl = template.Must(template.New("").Funcs(template.FuncMap{
|
|||||||
"safe": func(s string) template.HTML { return template.HTML(s) },
|
"safe": func(s string) template.HTML { return template.HTML(s) },
|
||||||
}).Parse(`
|
}).Parse(`
|
||||||
{% comment %}
|
{% comment %}
|
||||||
Matrix generated by build/generate/featureMatrix.go. DO NOT HAND EDIT!
|
Matrix generated by build/generate/featureMatrix.go. DO NOT HAND EDIT!
|
||||||
{% endcomment %}{{$providers := .Providers}}
|
{% endcomment %}{{$providers := .Providers}}
|
||||||
<table class="table-header-rotated">
|
<table class="table-header-rotated">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
{% comment %}
|
{% comment %}
|
||||||
Matrix generated by build/generate/featureMatrix.go. DO NOT HAND EDIT!
|
Matrix generated by build/generate/featureMatrix.go. DO NOT HAND EDIT!
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
<table class="table-header-rotated">
|
<table class="table-header-rotated">
|
||||||
<thead>
|
<thead>
|
||||||
@ -232,7 +232,9 @@
|
|||||||
<td class="success">
|
<td class="success">
|
||||||
<i class="fa fa-check text-success" aria-hidden="true"></i>
|
<i class="fa fa-check text-success" aria-hidden="true"></i>
|
||||||
</td>
|
</td>
|
||||||
<td><i class="fa fa-minus dim"></i></td>
|
<td class="success">
|
||||||
|
<i class="fa fa-check text-success" aria-hidden="true"></i>
|
||||||
|
</td>
|
||||||
<td class="success">
|
<td class="success">
|
||||||
<i class="fa fa-check text-success" aria-hidden="true"></i>
|
<i class="fa fa-check text-success" aria-hidden="true"></i>
|
||||||
</td>
|
</td>
|
||||||
|
@ -25,7 +25,7 @@ var docNotes = providers.DocumentationNotes{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
providers.RegisterDomainServiceProviderType("NS1", newProvider, docNotes)
|
providers.RegisterDomainServiceProviderType("NS1", newProvider, providers.CanUseSRV, docNotes)
|
||||||
}
|
}
|
||||||
|
|
||||||
type nsone struct {
|
type nsone struct {
|
||||||
@ -128,6 +128,8 @@ func buildRecord(recs models.Records, domain string, id string) *dns.Record {
|
|||||||
for _, r := range recs {
|
for _, r := range recs {
|
||||||
if r.Type == "TXT" {
|
if r.Type == "TXT" {
|
||||||
rec.AddAnswer(&dns.Answer{Rdata: []string{r.Target}})
|
rec.AddAnswer(&dns.Answer{Rdata: []string{r.Target}})
|
||||||
|
} else if r.Type == "SRV" {
|
||||||
|
rec.AddAnswer(&dns.Answer{Rdata: strings.Split(fmt.Sprintf("%d %d %d %v", r.SrvPriority, r.SrvWeight, r.SrvPort, r.Target), " ")})
|
||||||
} else {
|
} else {
|
||||||
rec.AddAnswer(&dns.Answer{Rdata: strings.Split(r.Target, " ")})
|
rec.AddAnswer(&dns.Answer{Rdata: strings.Split(r.Target, " ")})
|
||||||
}
|
}
|
||||||
@ -146,7 +148,7 @@ func convert(zr *dns.ZoneRecord, domain string) ([]*models.RecordConfig, error)
|
|||||||
Original: zr,
|
Original: zr,
|
||||||
Type: zr.Type,
|
Type: zr.Type,
|
||||||
}
|
}
|
||||||
if zr.Type == "MX" {
|
if zr.Type == "MX" || zr.Type == "SRV" {
|
||||||
rec.CombinedTarget = true
|
rec.CombinedTarget = true
|
||||||
}
|
}
|
||||||
found = append(found, rec)
|
found = append(found, rec)
|
||||||
|
Reference in New Issue
Block a user