PDA

View Full Version : Changing IP in DNS server



deltaned
01-23-2004, 12:51 PM
change the DNS settings to an other IP number in one step?
I had a code but my new computer doesent see my old disk so I lose it.

It is a little urgent, plz help!

DirectAdmin Support
01-23-2004, 01:05 PM
Hello,

To change all IP's from one to another via SSH for the dns records, you can run:


perl -pi -e 's/(^|[\s.=\/])1.2.3.4([\s.>:])/\${1}4.3.2.1\${2}/g' /var/named/*.dbor more simply, but likely to make errors:


perl -pi -e 's/1.2.3.4/4.3.2.1/g' /var/named/*.dbUse the first one if you can. This will change all occurances of 1.2.3.4 to 4.3.2.1 in the dns zones.

John