VPS moved to new IP - Batch update

On that screen, it says “This form allows you to manually edit the DNS records file /var/named/yourdomainnamehere.com.hosts” - I have dozens of these warnings in my Validation screen, and would like to get rid of them so as to make the results more readable and actionable.

Can anyone point me to or write a script to loop through the *.hosts files in that directory and replace the old address with the new address?

Thanks,
K

Howdy,

A simple way to change the IP address of all your Virtual Servers is to go into Addresses and Networking -> Change IP address.

Using that screen, you can update your old IP address to your new one for all Virtual Servers, and that should update all the DNS zone files you’re seeing there.

-Eric

I get this: No non private IP servers are using the old IP address

Yet, when I run Validation, I get the warnings: BIND DNS domain : The DNS record blah.com. resolves to the IP address oldip instead of the virtual server’s IP newip.

I have BIND disabled anyway, I just don’t want these false alarms clogging my Validation report.

I poked around Webmin in the BIND setup, but can’t find oldip anywhere.

Another clue, please ?

Thanks,
K

Hmm, so you aren’t using BIND on your server?

It sounds like some Virtual Servers may be configured to try and use it anyhow, which may be why Virtualmin is attempting to validate them against those zone files.

If you go into “Edit Virtual Server” for one of the domains that you get an error with – under Enabled Features, is “DNS domain enabled” checked?

-Eric

As you said…I unchecked one domain, saved, and ran Validation. It no longer has this error. However, I have about 25 domains that do. Is there any way to clear this flag en masse?

Best,
K

Like if Bind is off for a domain, or even not running on the server, don’t try to validate? Something like that.

Howdy,

The quickest way to do that would be with the command line tools. An example command to disable DNS in all the Virtual Servers would be to run the following as root from the Linux command line:

virtualmin disable-feature --all-domains --dns

Thanks, Eric. That was perfect.
It ran for several minutes…loooong, likely would have been an hour to do by hand.

Thanks!