Multi-server: remove no-local dns data, fast way?

Richard G

Verified User
Joined
Jul 6, 2008
Messages
14,187
Location
Maastricht
I've got multiple servers. Two of them are setup using the multi server setup, let's call them server1 and server2.
Server1 will remain as-is with the same dns and ip's.

Server2 will be migrated into another server which does not have the multi-server with server1.
So all non-local dns data needs to be removed from server1 as well as from server2.

They only way to see which is local and non local is in DA itself. However, if you have lots of domains, it's a bunch of work if you have to select all non-local domains manually and then delete them, which also increases the chance for failures.

Is there another way to remove all non-local DNS data from a former multi-server setup? Or can it only be done one by one manually from within DA?

I've read this thread:
http://forum.directadmin.com/showthread.php?t=47402
but there was no solution in there for my needs.
 
Have you tried just shutting off the multi-server option for each server? Does that remove them?

Jeff
 
Yes I tried that last year. That just shuts down the multi-server sync but does not remove anything. Unless this is changed in the last 3 DA version updates, but I doubt that.
 
You might need to write a script or to get someone to do it for you. The idea is rather simple

1. Compare a list of zones in /etc/named.conf with a list of domains in file /etc/virtual/domainowners
2. Those domains which are presented in /etc/virtual/domainowners are LOCAL domains, the others aren't.
3. Remove lines from /etc/named.conf which are describing not local domains (and zone files from /var/named/).

That's it.
 
Hello,

I'm not sure if I'm missing something, but the quickest way would take a few clicks in DA.

1) Admin Level -> DNS Admin -> Advanced Search

2)
-"Local Data" - contains - "No"
- Items per page - "All"
- then Search

3) confirm you only see "Local Data = No" listed.
Click "select", click Delete.


If you have the MSS linked up to the other box, it will delete the zones from the other box.... so ensure you're only deleting the zones you want to be deleting.

---------

- This might be a side note.. but if you leave the MSS on when deleting a domain through DA, it will remove the zones from all boxes that it was added to.
- Also, if you have MSS on the new box, pointing to the other boxes (with zone-check disabled for initial setup), it will overwrite existing zones on the remote boxes.

John
 
Thank you John. Unfortunately, this does not list any domain at all.

I tried with almost every option under Local Data, but nothing works and I thing you got a bug in the search option.
Because when I use the domain contains (left site next to "Local Data") and only put "a" in there, it lists me all domains which has an a in it.
However, the moment i fill in anything in the "Local Data" and/or "Local Mail", it will return a "no data to show".

So your solution would be the fastest way, if the search function would work like it should. :)

@zEitEr: Thank you, but I think the search function would be also great if it worked.
 
Last edited:
**scratches head**

Hmm.. works on my end.. you're entering the text:
Code:
No
into the Local Data searchbox? (seems to be working on our test system)
Also ensure the other search files are 100% blank.. as if there is a space, that would search for a space, which doesn't exist in a domain name.

To rule out any search issues.. so it's doing exactly what I'm doing, here's the URL to append onto your IP:
Code:
:2222/CMD_DNS_ADMIN?comparison1=none&comparison2=contains&comparison3=none&value1=&value2=No&value3=&sort1dir=1&sort1=1&sort2dir=1&ipp=1000
You can click "Advanced Search" after following it, so you can see what I've searched..

John
 
Hi John.

It's a case sensitivity issue. Your link is working.
But you really have to use "No", if you fill in "no" or "NO" then you won't get a result. But I can use it now, thanks!
 
Back
Top