Issue with IP address

Webbera

Verified User
Joined
May 26, 2017
Messages
6
Hi ;)

I need little help ;)

I have users that have wrong IP address in DNS zone. So I need to update about 1000 users on my server with new DNS A record. I was searching for solution however I'm not able to see it on help site.

This is what I currently have:
ftp A 212.XX.XX.XX
mail A 212.XX.XX.XX
domain.com. A 212.XX.XX.XX
pop A 212.XX.XX.XX

And I want to update it to:
ftp A 212.YY.YY.YY
mail A 212.YY.YY.YY
domain.com. A 212.YY.YY.YY
pop A 212.YY.YY.YY

For all users on my server, is there any way to do this instead manually :)
 
Update ;)

I fix it using perl, this is what I did ;)

cd /usr/local/directadmin/data/users
perl -pi -e 's/212.XX.XX.XX/212.YY.YY.YY/' */user.conf


cd /var/named
perl -pi -e 's/212.XX.XX.XX/212.YY.YY.YY/' *.db

Lest step I update named ;)

echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
 
Hello,

The script /usr/local/directadmin/scripts/ipswap.sh should do the IP replacement:



Usage:


Code:
/usr/local/directadmin/scripts/ipswap.sh <oldip> <newip> [<file>]
 
Back
Top