Skip to content

Commit

Permalink
add support for NS records
Browse files Browse the repository at this point in the history
  • Loading branch information
giornetta committed Nov 4, 2024
1 parent 7f2195b commit 416d844
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func init() {
Flags for domain record create cmd
*/
domainRecordCreateCmd.Flags().StringVarP(&recordName, "name", "n", "", "the name of the record")
domainRecordCreateCmd.Flags().StringVarP(&recordType, "type", "e", "", "type of the record (A, CNAME, TXT, SRV, MX)")
domainRecordCreateCmd.Flags().StringVarP(&recordType, "type", "e", "", "type of the record (A, CNAME, TXT, SRV, MX, NS)")
domainRecordCreateCmd.Flags().StringVarP(&recordValue, "value", "v", "", "the value of the record")
domainRecordCreateCmd.Flags().IntVarP(&recordTTL, "ttl", "t", 600, "The TTL of the record")
domainRecordCreateCmd.Flags().IntVarP(&recordPriority, "priority", "p", 0, "the priority of record only for SRV and MX record")
Expand Down
4 changes: 4 additions & 0 deletions cmd/domain/domain_record_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ var domainRecordCreateCmd = &cobra.Command{
newRecordConfig.Type = civogo.DNSRecordTypeSRV
}

if recordType == "NS" || recordType == "nameserver" {
newRecordConfig.Type = "NS" // TODO (giornetta): change this to civogo.DNSRecordTypeNS
}

record, err := client.CreateDNSRecord(domain.ID, newRecordConfig)
if err != nil {
utility.Error("%s", err)
Expand Down

0 comments on commit 416d844

Please sign in to comment.