home-dns-refresh
is a CLI job that looks up the current external IP, and updates an Azure Zone A Record to that IP if its different.
The A Record must be resolvable, so that it may check if its the same or different.
sh
cargo install home-dns-refresh
Run the command to display the usage:
sh
home-dns-refresh --help
Which will show the options to run with:
``` home-dns-refresh Updates an Azure DNS zone A record to the currently external IP address
USAGE:
home-dns-refresh [OPTIONS] --client-id
FLAGS: -h, --help Prints help information -V, --version Prints version information
OPTIONS:
-c, --client-id
-p, --client-secret
-r, --resource-group
-d, --sub-domain
-s, --subscription-id
-t, --tenant-id
--ttl
-z, --zone-name
```
```hcl job "homednsrefresh" { datacenters = ["dc1"] type = "batch"
periodic { cron = "*/5 * * * * *" prohibit_overlap = false }
group "homednsrefresh" { count = 1 task "homednsrefresh" { driver = "docker"
config {
image = "ghcr.io/haribo256/haribo256/home-dns-refresh:<version>"
args = [
"--tenant-id", "<tenant-id>",
"--subscription-id", "<subscription-id>",
"--resource-group", "<resouce-group>",
"--zone-name", "<azure-zone>",
"--sub-domain", "<subdomain-on-azure-zone-to-update>",
"--client-id", "<azure-client-id>",
"--client-secret", "<azure-client-secret>"
]
}
restart {
attempts = 0
mode = fail
}
resources {
cpu = 100
memory = 20
}
}
} } ```