Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
diy_rfc2136_dyndns_with_bind [29.10.2013 13:56] – Pascal Suter | diy_rfc2136_dyndns_with_bind [29.10.2013 14:44] – Pascal Suter | ||
---|---|---|---|
Line 2: | Line 2: | ||
ever since dyndns stopped to be completely free (including hassle-free) i was looking for alternatives. i recently stumbled across RFC2136 which can be used to provide dynamic dns services. since i have access to two nameservers running bind i decided to try it out.. it works pretty nicely :) | ever since dyndns stopped to be completely free (including hassle-free) i was looking for alternatives. i recently stumbled across RFC2136 which can be used to provide dynamic dns services. since i have access to two nameservers running bind i decided to try it out.. it works pretty nicely :) | ||
- | there is a [[https:// | + | there is a [[https:// |
this following howto will explain how i did my setup so that i could have a little bash script that would allow me to add new hosts to my dyndns with a single command. all my hosts will end with .dyn.mydomain.ch. | this following howto will explain how i did my setup so that i could have a little bash script that would allow me to add new hosts to my dyndns with a single command. all my hosts will end with .dyn.mydomain.ch. | ||
Line 22: | Line 22: | ||
900 | 900 | ||
600 | 600 | ||
- | 2600 ; expire (43 minutes 20 seconds) | + | 604800 |
30 | 30 | ||
) | ) | ||
Line 78: | Line 78: | ||
-rw-r--r-- 1 root bind 322 Oct 29 13:45 named.conf | -rw-r--r-- 1 root bind 322 Oct 29 13:45 named.conf | ||
</ | </ | ||
+ | * now use the script to add your first hostname. < | ||
+ | ===== script to remove hosts ===== | ||
+ | optionally you can also create a little script to remove hosts just as easily. create a file called remove_hosts.sh with the following contents< | ||
+ | #!/bin/bash | ||
+ | if [ -z " | ||
+ | echo " | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | cd / | ||
+ | hostname=${1}.dyn.mydomain.ch. | ||
+ | echo "old keys.conf entry: " | ||
+ | grep ${hostname} keys.conf | ||
+ | echo " | ||
+ | cat named.conf | sed -e "/ | ||
+ | cat keys.conf | sed -e "/^key ${hostname}.*$/ | ||
+ | echo " | ||
+ | / | ||
+ | echo " | ||
+ | grep "key " named.conf | awk '{ print $2; }' | tr -d ";" | ||
+ | </ | ||
+ | make it executable and run it to remove hotsts. **warning** make a backup of your keys.conf and your named.conf file before testing this :) | ||
+ | ./ | ||
+ |