Changing TTL/other values + bulk changes

Webcart

Verified User
Joined
Jan 14, 2004
Messages
398
Hello,

I was wondering if there is a way to define custom values for TTL and such while keeping domain.db files managable via DA?

Also, is there a way to make bulk changes, like changing nameservers for all domains at once?

Thank you.
 
Hello,

You can change the TTL via the templates system:

cd /usr/local/directadmin/data/templates
cp named.db custom
cd custom

edit the TTL (2 instances). Default is 14400. Any changes to a dns record will then use the new custom named.db file with the new TTL.


To do a mass nameserver change, the easiest is to just use perl:

perl -pi -e 's/ns1.oldns.com/ns1.newns.com/' /var/named/*.db

Do that for both ns's you want to change. You'll probably also want to change the values for in the user.conf file for new domains, eg:

perl -pi -e 's/ns1.oldns.com/ns1.newns.com/' /usr/local/directadmin/data/users/*/user.conf

John
 
Thank you very much for your answer.

I kinda figured out templates part, but wasn't sure what |string| to use for the domain name.

Here is how template looks like:
|?TIME=14400|
$TTL 14400
@ IN SOA |NS1| |EMAIL| (
|SERIAL|
7200
3600
1209600
86400 )

|NS|
|A|
|MX|
|CNAME|
|PTR|

The part I would like to change is
example.com. 14400 IN NS ns1.webstores.net.
example.com. 14400 IN NS ns2.webstores.net.

to
example.com. 172800 IN NS ns1.webstores.net.
example.com. 172800 IN NS ns2.webstores.net.
to get it in sync with the parent servers. What's the string that would be substituted with domain name? (I tried |DOMAIN|, but it didn't work).
Also, what's the command to enforce rewrite of all *.db files according to the new custom template?

Thank you.
 
Hello,

|?TIME=172800|

Also, for new domains, just run and edit:

cd /usr/local/directadmin/data/templates
cp dns_*.conf custom
cd custom
vi dns_a.conf
...

That's probably the templates you want.. new domains use the dns_*.conf templates for their values.

John
 
John, sorry to bother you again with this issue, but I would really like to change TTL values for NS records only.

This is to avoid "NS TTL discrepancy warning" with DNS report tool generated when TTLs for NS records at parent nameservers do not match TTLs at authorative nameservers.
At the same time, I would like to have TTL values for A records low, which would allow us to make a fast switch to backup servers when necessary.
I tried to add |?TIME=172800| to dns_ns.conf file in the hope that it would limit the scope of the variable to NS records, but it didn't work.

Here is the example of how I would like it to be set up:

@ IN SOA ns1.webstores.net. root.example.com. (
2004050501
7200
3600
1209600
86400 )

example.com. 172800 IN NS ns1.webstores.net.
example.com. 172800 IN NS ns2.webstores.net.

ftp 14400 IN A 66.249.130.7
mail 14400 IN A 66.249.130.7
pop 14400 IN A 66.249.130.7
example.com. 14400 IN A 66.249.130.7
www 14400 IN A 66.249.130.7

example.com. 14400 IN MX 0 example.com.

Does it make sense?
 
Last edited:
Unfortunately, the template system for the dns settings isn't quite that flexible. The change could be manually made directly to the file, and then don't make any changes to the dns record through da, or else chmod it to 444 so that da can't write to it.

John
 
Mark,

This is going to remain a problem into the future, as DNS Report was changed to show this as a warning.

It's not really as critical as most people would think, and the actual "problem" has been around forever, but now that DNS Report is marking it with a warning, it needs to resolved to avoid multiple tech support calls and long explanations.

Can you consider adding per-line TTL (as an option) into your DNS system?

Thanks for the consideration.

Jeff
 
That would work :) .

For most of us NS records are possibly the only one's we'd need to be different than the rest of our records.

Jeff
 
jlasman said:
It's not really as critical as most people would think, and the actual "problem" has been around forever, but now that DNS Report is marking it with a warning, it needs to resolved to avoid multiple tech support calls and long explanations.

You just read my mind :)
 
Back
Top