I created a child-domain "dyn"
dyn IN NS server1
dyn IN NS server2
The "dyn.mydomain.example"
Code:
$ORIGIN .
$TTL 5 ; 5 seconds
dyn.mydomain.example IN SOA localhost. root.localhost. (
1997022716 ; serial
60 ; refresh (1 minute)
60 ; retry (1 minute)
3600000 ; expire (5 weeks 6 days 16 hours)
10800 ; minimum (3 hours)
)
NS server1
NS server2
$ORIGIN dyn.mydomain.example
home A 1.2.3.4
So now "home.dyn.mydomain.example" is the DNS entry that I'll change.
In named.conf
Code:
zone "dyn.mydomain.example" {
type master;
file "src/dyn.mydomain.example";
allow-update {127.0.0.1;};
};
This is weak security 'cos anyone on localhost would be able to update this domain, but since I'm the only one...
Now I can update the value easily:
Code:
#!/bin/sh
nsupdate -v << EOF
server 127.0.0.1
zone dyn.mydomain.example
update delete home.mydomain.example
update add home.dyn.mydomain.example. 5 IN A $ip_address
send
EOF
That's how I do it for my home machine. (In fact I run DNS on my home machine and then notify my linode to pick up the updates).
After that you just to decide on how you pick up your IP address and populate it. A simple CGI could do the job.