FR: Rewrite command to rebuild DNS for SINGLE domain

interfasys

Verified User
Joined
Oct 31, 2003
Messages
2,100
Location
Switzerland
Right now we only have this:
Code:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
which means that we have to manually rebuild DNS zones if we want to fix just a few domains.
Scripts like this:
http://help.directadmin.com/item.php?id=330
could be shortened a lot if we could get an improved command to send to the task queue. It would also remove some of the pains of maintaining scripts in sync with templates.

And to make admins waste even less time, this could be implemented at the same time, making sure custom settings wouldn't get lost with a rebuild:
http://directadmin.com/forum/showthread.php?t=38814
 
Well, I've tried and it does't seem to be working.

Test 1)
Delete some entries and send command
Result: Nothing is added

Test 2)
Delete the zone file and send command
Result: The zone is lost forever

What is the script supposed to be doing if it doesn't pass these tests?
 
Last edited:
Test1) Where exactly and what entries did you delete?
Did you do it on the same server, where you send command? If you deleted some lines from domain zone, it won't be re-added with that command.

Test2) If you delete zone manually on the same server, where you send command, as far as I know, it won't be rebuild. But it will be generated, if you send command from another box with «Multi Server» Function switched on.

It can be used to move zones on another server with «Multi Server» Function switched on; to lower TTL just before an IP change; etc.

But no deleted records will be re-added. It would mean loosing all customized settings within a particular zone.
 
1) domain.com.db. A random entry like ftp or pop
Since it's now different from the template (named.db), I was expecting the script to add the missing entries.

2) It was just to see if it was supposed to only be used when the file had been deleted.

So, from your pov, this is only to make sure the right IP is used and to adjust TTLs? That's not how I read "rewrite all dns files with the named.db file" from the "documentation". This is supposed to overwrite custom modifications.
 
No, that command won't overwrite any custom modifications, if used on the same server, where you did changes. We use this command to move updated DNS zones to all servers, which are used with Multi Server Functions.
 
Hello,

To clarify, the dns_*.conf files are *only* used when a zone is created (or when the "Reset Defaults" button is used)

The rewrite reads in a db file, parses it to load in all of the values (A, NS, MX, etc).. then uses the named.db template, and inserts all of the loaded values into the template and saves it.

New values won't show up based on the dns_*.conf files when a rewrite is issued, so if Users are deleting values, they won't magically re-appear.


If your goal is to reset a domain to add missing values, you'd want to use the Reset Defaults option, but it doesn't have a command line method of accessing it (unless you create a script to use it via the API)

John
 
I see. It's more like a beautifier then. Can come in handy since you would only need to append your entries and then run the script to make it look good.
 
I have a similar request, I know we can rewrite a single domain like this:

Code:
echo "action=rewrite&value=named&domain=domain.com" >> /usr/local/directadmin/data/task.queue

However what I need is to be able to rewrite all domains for only ONE user account, for example like this:

Code:
echo "action=rewrite&value=named&user=USERNAME" >> /usr/local/directadmin/data/task.queue

However I have not found any mention of it when searching. Is something like this possible?
 
Back
Top