Only update A domains, since we're mapping to an IP.

This commit is contained in:
Mike Cheng 2017-01-18 18:54:55 -05:00
parent 429deee7d2
commit ebc13d7f8b
2 changed files with 10 additions and 3 deletions

View file

@ -6,7 +6,7 @@ Client that automatically updates name.com DNS records.
Since name-dyndns has no external dependencies, you can get it simply by:
```go
go get github.com/mfycheng/name-dyndns.git
go get github.com/mfycheng/name-dyndns
```
## Requirements

View file

@ -4,11 +4,12 @@ package dyndns
import (
"fmt"
"github.com/mfycheng/name-dyndns/api"
"github.com/mfycheng/name-dyndns/log"
"strings"
"sync"
"time"
"github.com/mfycheng/name-dyndns/api"
"github.com/mfycheng/name-dyndns/log"
)
var wg sync.WaitGroup
@ -87,6 +88,12 @@ func runConfig(c api.Config, daemon bool) {
continue
}
// Only A records should be mapped to an IP.
// TODO: Support AAAA records.
if r.Type != "A" {
continue
}
log.Logger.Printf("Running update check for %s.", r.Name)
if r.Content != ip {
r.Content = ip