Server wide change of IP addresses?

Hi,

I was wondering if there is a built-in tool in the case that you need to change IPaddresses.

I have virtualmin installed in a VM and will be moving that VM to a different hosting provider and obviously will need to change the IPs when I start it back up.

Is there a simple tool to do this? Perhaps a shell script that does the job. I did try to search the forum for the answer to this but the only one I found was (https://www.virtualmin.com/node/4636) and no answers to it.

Thanks

Howdy,

You’d need to do two things there.

If you’re trying to change your server to use a new IP address, you’d first change the network interface in Webmin -> Networking -> Network Interfaces.

However, that doesn’t change the configuration for your various domains.

To do that, you’d go into Addresses and Networking -> Change IP Address, and specify the new IP of your system.

-Eric

Thanks eric,

Is it safe to assume there’s no gotchas that might come and bite me later on? IE DNS, mail, or some hidden settings. Gotta burned with some other panels out there so I just wanted to make sure.

There shouldn’t be any gotchas! If there are, it’s probably a bug – and then let us know, as we’d like to fix it :slight_smile:

After changing your server’s IP address, all the config files containing your old IP would now be incorrect – that includes the various concerns you had – DNS entries, Apache config files, and the like.

However, any IP address setting that Virtualmin knows anything about will be updated when you run the “Change IP Address” function", and tell it about your new IP address.

The biggest gotcha I can think of is that DNS entries can be cached, so if you do any DNS lookups of domains on your server, and you then later change those IP address – it can take a day or so before that cache clears from the computer you used to do that lookup. If you’re concerned that this might be a problem, you could always lower the DNS TTL first.

-Eric

I did a datacenter move not too long ago and followed what Eric posted above. It went flawlessly. I would highly recommend changing your DNS TTL to like 5 or 10 minutes until after they are moved. I’d do this a few days in advance of the move (or just a few hours longer than your current TTL is set to). Your websites will almost be immediately accessible if you do. If you don’t, they could take several days, depending on what your current TTL is set to.

Hello,

The “Change IP” function does not see to work to update DNS records after a move to another server (I simply restored the backups on the new server). My DNS records indicate “Warning - errors were found in this domain’s DNS records : The DNS record MYDOMAIN resolves to the IP address 91… instead of the virtual server’s IP 37…”

91… is the old IP, of course.

If I try updating the IP globally, putting 91 as old and 37 as new, whether for real address or DNS, it tells me “no server needs updating”.

On the other hand, going to Webmin / Servers / BIND DNS / Update records in selected seems to have done the trick.