update @ record as well

This commit is contained in:
Viktor Barzin 2024-12-02 21:50:44 +00:00
parent fd5b8bdaf7
commit dcf4bdf9c6
3 changed files with 8 additions and 3 deletions

View file

@ -57,8 +57,13 @@ func UpdatePublicIPViaTechnitiumAPI(newIp net.IP, username string, password stri
if err != nil {
return errors.Wrap(err, "failed to get technitium token")
}
for _, ns := range []string{"ns1", "ns2"} {
nsRecordName := ns + ".viktorbarzin.me"
for _, ns := range []string{"ns1", "ns2", "@"} {
nsRecordName := ""
if ns == "@" {
nsRecordName = "viktorbarzin.me."
} else {
nsRecordName = ns + ".viktorbarzin.me"
}
currIpStr, err := getRecordValue(token, nsRecordName, "A")
if err != nil {
return errors.Wrap(err, "failed to get A record for ns server")