Virtualmin has this nice feature where you can enable dynamic host and virtualhost updates so when your ip changes virtualmin updates the ips in the virtualhosts definitions. Without this feature your sites would not work anymore if your ip changes and you would have to update the ips manually.
The problem with this feature is that it only supports the DynDNS service and not everyone is using this service to update their host when their ip changes.
I'm using my own dynamic dns service and the good news is that this service is using the same protocol as DynDNS so virtualmin needs little change in order to support it.
All I had to do was add a way of specifying the hostname and port of the dynip update server.
Here's the patch for virtualmin ( tested with 3.75 and 3.76 ) :
Q: Why would you want to run your own dynamic DNS service?
A: Because you have your own domains that you want to use as the parent domains for your hosts and you already have all required ingredients ( a linux server with a static ip that's always up and runs bind and apache with php )
Q: How do you run your own dynamic DNS service?
A: get DDNS Server, read the README file and set it up. The nice thing about this script is that it uses the same protocol as the popular DynDNS service so any dynamic ip update client like ddclient would work with this script. Of course the client would have to allow you to specify the hostname or ip and port of the dynamic dns server.
Oh and one more thing, if you're running bind you're probably running it in a chroot environment so you'll have to apply the following patch to DDNS Server ( current version 1.0.0 ) to make it work with the chrooted bind :
This patch adds a new configuration option named BIND_CHROOT ( in config.php ) that has to be set to the path of the chroot environment where bind runs. Eg. on centos 5.3 this is /var/named/run-root .
For any questions or suggestions hit the comments.
Have a question about unix, linux, freebsd. Or maybe you want some advice about configuring apache, mysql,an email server like exim, qmail, postfix, a proxy server like squid cache or antinat, dns or anything else similar. Want some help with php programming or maybe you want to create a wordpress plugin?
Feel free to ask and I'll do my best to answer it on this blog. I will publish a new blog post for each question and my answer.
You can use the contact form or ( if your question is short enough ) you can send it to me over twitter
You can follow me on twitter or subscribe to my RSS feeds if you want to be notified when I post the answer to your question.