View Single Post
Old 9th February 2010, 02:40
patrick3853 patrick3853 is offline
Join Date: Dec 2008
Posts: 30
Thanks: 3
Thanked 7 Times in 3 Posts

I recently changed the IP addresses of a server running ISPConfig 2 and stumbled upon this thread. Since the server was hosting many sites, I was looking for a more effecient way to update the IP for all the sites in ISPConfig. Thought I would share my solution in case anyone else has this issue.

Please note: this worked for me on ISPConfig 2 running on Ubuntu 8.10. Location of config files my be different depending on your system.

After you change the IP on the system, log into ISPConfig and replace the IP address under Management > Server > Settings. Then replace the IP address in config files: represents new IP
yyy.yyy.y.yy represents old IP

perl -pi -e 's/yyy\.yyy\.y\.yy/' /var/lib/named/etc/bind/*
perl -pi -e 's/yyy\.yyy\.y\.yy/' /etc/apache2/vhosts/*
Now, log into MySQL, use the ispconfig database, and run the following queries to update the IP in ISPConfig:

DNS Manager
UPDATE dns_a SET ip_adresse = '';
UPDATE dns_isp_dns SET dns_soa_ip = '';
ISP Manager
UPDATE isp_isp_web SET web_ip = '';
UPDATE isp_isp_domain SET domain_ip = '';
Of course, you will need to restart apache and bind. Now all sites should load and when you log into ISPConfig you will see the new IP for each site and all your DNS records. Go to one of your sites under ISP Manager, make a minor change and hit save so that ISPConfig rewrites the config files. Then verify that ISPConfig is using the new IP and you're good to go.
Reply With Quote