iptables allow dyndns domain name and auto update rules
- by user3215
I have registered with dyndns domain for my dynamically changing public ip address to use with iptable rules. On a server I've allowed some ports for this domain in the iptables configuration like the below entries:
-A INPUT -s mycompany.dyndns.com -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s mycompany.dyndns.com -p tcp -m tcp --dport 3306 -j ACCEPT
-A INPUT -s mycompany.dyndns.com -p tcp -m tcp --dport 21 -j ACCEPT
But when ever my modem restarts, I couldn't connect to these allowed ports as public ip changes with modem restart and are not updated in the iptables on the server. Is there any option to automatically update iptable rules on server.