Option: "Restore with Local NameServers", does it work?

Aspegic

Verified User
Joined
Aug 4, 2005
Messages
283
[SOLVED] "Restore with Local NameServers", does it work?

The option "Restore with Local NameServers" either doesn't work, or it does something different from what I assume it would do.

I thought that if this option is enabled, it would replace the names of the NS records in the backup, with the names of the NS records from the server on which I am restoring the account.

I made a backup of an account on a server that uses name servers ns1.pjdn003.nl and ns2.pjdn003.nl.
I restored this account on another server that uses ns1.pjdn004.nl and ns2.pjdn004.nl.

I enabled the option "Restore with Local NameServers" on the target server before restoring.
But after the restore, the DNS records for the restored account still have ns1.pjdn003.nl and ns2.pjdn003.nl.

Do I misunderstand what the option does?

PS1. I have NS1 and NS2 setup correctly in "Administrator Settings" on both servers.
PS2. I tried both "Admin Backup/Transfer" from Admin Level as well as "Manage User Backups" from Reseller Level, both with the same result.
 
Last edited:
I thought that if this option is enabled, it would replace the names of the NS records in the backup, with the names of the NS records from the server on which I am restoring the account.
That is correct and it was/is working that way.
I also had some time that it left ns1 in place and added the new ns1 and ns2.

Beware that the option is not enabled by default and you have to enable it (and click save) -before- you do any restore.
If you restore afterwards, it should work like you think it does.
I must say I also create the domain before restoring (in your case pjdn004.nl) and add the nameservers in there too, this might not be necessary.

PS1. I have NS1 and NS2 setup correctly in "Administrator Settings" on both servers.
Is that the only place?
Try to also enable it in your admin account on Reseller level -> Extra features -> Nameservers and create them there.
It has to say below there "Set the Nameservers that will be assigned to new users" to your pjdn004.nl nameservers, otherwise it probably won't work either.
 
Hi Richard, thanks for replying.

Yes, the nameservers are setup correctly under Reseller Level > Nameservers.
It just doesn't work. I tried another account just now, same result.

The problem is, I need to transfer 165 accounts and it is a tedious job to have to manually correct the NS records for every account after each restore.
I could just restore them all, then download *.db from /var/named, then do a Search&Replace over all these files and then upload them back. But this shouldn't be necessary.

Anyway, maybe an admin will read this and look into it.

Thanks again!
 
I'm am an admin. :)
You might however send in a ticket:
https://tickets.directadmin.com/

I presume you did, but just to be sure, when selecting the backup to restore, did you also select the "Use the IP from the list:" and select the correct ip address in the restore manager?

Attached a picture.
restore.jpg
 
Last edited:
With "admin" I was referring to someone from JBMC Software. I'm an admin myself too ;)

But I did manage to solve the problem. I also think I know the origin of the problem...

When I first installed the new server pjdn004, during setup of directadmin, I enter mail.pjdn003.nl as the hostname.
I realised my mistake when setup was well underway, but I thought I would change it later after setup had completed.
So, after directadmin was setup and working correctly, I went into Administrator Settings and changed the server's hostname to mail.pjdn004.nl. All was well, or so I thought.

After setting up the nameservers to ns1 and ns2.pjdn004.nl (both in the admin and reseller section), I started backing up accounts on the old pjdn003 server en restoring them on the new pjdn004 server. And that was when I discovered the problem as originally described.

It appears as if the names of the name servers as you see them in the directadmin user-interface are not the values used for replacing the nameserver names during restore (if you enable that option). But that's what you would expect, right?
Instead, it looks as if directadmin uses named.conf and the corresponding db file in /var/named
In those files, the hostname was still listed as pjdn003, even after I had changed the hostname to pjdn004 in Administrator Settings. But I only discovered that today. Only after manually modifying named.conf and renaming mail.pjdn003.nl.db into mail.pjdn004.nl.db and replacing pjdn003 into pjdn004 inside the pjdn004 db file did it start to work as it should.

Now when I restore accounts on the pjdn004 server, their nameservers are set correctly to ns1 and ns2.pjdn004.nl.

I suspect that directadmin works as designed with this feature. It's just that when using the user-interface, one assumes certain things that turn out not to be true. I think that part could be handled better.

Anyway, I'm happy it is working :)

Thanks Richard for trying to help. Much appreciated!
 
Last edited:
And just now I discovered a second situation in which case the nameservers in the backup are not overruled by the nameservers of the target server:

If the account your are trying to restore already exists on the target server (so you are restoring a backup, overwriting an existing account) then the nameservers of the target server are not used.
 
With "admin" I was referring to someone from JBMC Software. I'm an admin myself too :)
I knew you ment that and that you are too, otherwise you would not have admin rights on your server. I just made some fun, that's why the smilie was placed. :D

I think that part could be handled better.
I agree with that! Glad you figured out the cause, this could have taken some searching. :)

If the account your are trying to restore already exists on the target server (so you are restoring a backup, overwriting an existing account) then the nameservers of the target server are not used.
That could indeed be the case. I don't know if that is a bug or not. I normally do never overwrite exising accounts, or otherwise I delete them and restore them again.
However, I always create the admin account and have seen a couple of times when overwriting the admin account, the old nameservers were saved and from the target nameserver only one was added (instead of replaced).

So this might be some bug, maybe SMtalk or DA staff can comment on that. I'm curious if others experienced this too.
 
Back
Top