modifying DNS templates

ReN

Verified User
Joined
Jul 2, 2005
Messages
172
hey guys i need to add an entry into the dns templates then apply it globally to rewrite the dns info.
Basically i want to add a second MX entry into all current domains.

any ideas would be greatly appreciated.
 
Try this:

make a copy of the template in the cusotm directory.

Modify it there.

Run this as root:
Code:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
Does this work?

Jeff
 
hey jeff, thanx for your reply , long time no speaka :)

i copied the following into custom:-

dns_a.conf
dns_mx.conf

Then applied the command you suggested , i did locate this also here in the forums a few days ago with no effect , i just tried it again just to be sure and nothing, the *.db fiels all get updated to current date ( serial) etc but no modifications.

Unless i'm modifing the wrong template, any suggestions would be great.
 
I know I did smething similar, but it was a long time ago and I don't recall the details. Unfortunately I have no other ideas except to offer my commercial service so I can figure it out for you, or else hopefully someone else will respond.

Jeff
 
Thank you for your input jeff, its much appreciated as always. i've been using DA for some time now, maybe DA support themselves might chime in on this one for me.
 
Hello,

That command:

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

won't help you here. As it does not apply any changes to A,MX,CNAME, etc records. It can be used only to update TTL and some other figures, and of course to transfer all zones to a remote server (when using Multiserver function).

To do what you need, you'd better write a simple PHP/PERL/SH script. And after you get all *.db updated, run that code, to move changes to any server of your DNS-cluster, of course if you use any.

Other way, you can go, it's to reset all zones to default state, and in this case, MX records would be updated. But of course you'll loose all custom records in all zones.
 
Years ago we added a second MX to all domains on one of our servers, to use with what we call nolisting. I remember we changed a file in custom with a hardmade line for the 0 MX (since before then the lowest MX was 1), ran either the action line above, or some other action line, and then after checking that the new MX was installed successfully (it was) we just deleted the file from the custom directory. I wish now we had saved it.

Does anyone have a list of all the action rewrite commands?

Jeff
 
I think I figured it out; I think the change needs to be made to named.db file, adding the line(s) for the specific record you're adding, not using any variables. But I still need to know the correct action rewrite command to get it to update.

Then afterwards, of course, delete the custom/named.db file.

Jeff
 
That's a trick. Good to know that.

That is the only known to me command line for DNS zones updating:

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

I've checked your quess, that do the trick, with the command above.

Code:
# cat /usr/local/directadmin/data/templates/custom/named.db
|?NS_TIME=14400|
|?A_TIME=14400|
|?MX_TIME=14400|
|?CNAME_TIME=14400|
|?PTR_TIME=14400|
|?TXT_TIME=14400|
|?AAAA_TIME=14400|
|?SRV_TIME=14400|
$TTL 14400
@       IN      SOA     |NS1|      |EMAIL| (
                                                |SERIAL|
                                                14400
                                                3600
                                                1209600
                                                86400 )

|NS|
|A|
|MX|
|DOMAIN|.    14400   IN      MX      10 mail.myisp.com.
|CNAME|
|PTR|
|TXT|
|AAAA|
|SRV|

after that:

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

I waited a minute or so, and I've got now:

Code:
# grep MX /var/named/domain.ru.db
domain.ru.   14400   IN      MX      10 mail
domain.ru.    14400   IN      MX      10 mail.myisp.com.

That's a trick. Good to know that.

N.B. You won't roll back the changes the same way.
 
Last edited:
Note to everyone; in a real installation you probably won't want to MX records with the same cost/value. You'll probably want your main mailserver to have a lower number than the one to use when the main one isn't available.

Jeff
 
Back
Top