How do I change NS records for ALL domains on server?

Icheb

Verified User
Joined
Sep 15, 2003
Messages
514
Location
The Netherlands
I've got 'some' issues with a DDoS, main server has been down for 18 hours.

Now it's temporarely up again, I need to change the primary nameserver for all domains on all servers. This is a bit of a irritating job, so is there any way to do this all at once ?

I've got a NS record that states the primary NS is ns1.sebsoft.nl, but it has to become ns3.sebsoft.nl.
 
It's probably too late for you now, but for the sake of the archives, you can do edits across multiple files this way:

perl -i.bak -p -e 's/ns1.sebsoft.nl/ns2.sebsoft.nl/ig' filename

where "filename" should be replaced by a mask identifying the files you're changing.

Once it's done you should move or delete the *.bak files, after checking to make sure everything is done the way you want it.

But...

don't forget you also have to make the same changes at the registry of each domain or this isn't going to help.

You'd probably be better off just changing the IP# of ns1.sebsoft.nl at your registration provider for sebsoft.nl.

Jeff
 
Well, I already did the last one :)

Cost me a favor from a collegue (all my servers are in the same network :() and some money, but I think it will do great things for the uptime.

Later today I'm going to post another thread in (probably) tech with the next issue... (Moving to another datacentre but keeping the servers, but I'll have to write up a situation overview for that first).

But still I would like to thank you for the help :).

However, while still thinking about this one, this will also change SOA information. DA already did that for me somehow yesterday, I manually edited the files back to normal (and ofcourse I checked if DA would do it right next time, which is does :)).
 
Back
Top