change standard DNS settings

bvvelzen

Verified User
Joined
Oct 30, 2003
Messages
82
Location
Netherlands
Is it possible to change the standard db file for a domain?

I couldn't find it, only at templates -> named.db but I am not
sure to add something there that is should work?

Greeting,
 
My understanding is that you may use the template to make changes, but my recollection is that the changes will affect all domains.

What are you trying to change?

Jeff
 
jlasman said:
My understanding is that you may use the template to make changes, but my recollection is that the changes will affect all domains.

What are you trying to change?

Jeff

I Want to add ftp.domain.com to 1 ip adres.
 
For all new domains?

Well... you could do the following:

Create the following file:
/usr/local/directadmin/scripts/custom/domain_create_post.sh

and fill it with the following:
Code:
#!/bin/sh

STR="/usr/bin/perl -pi -e 's/^ftp.*/ftp\t14400\tIN\tA\t1.2.3.4/'  /var/named/${domain}.db"
eval $STR

exit 0;

That will be run after each domain is created. It will seek out ftp in the zone and give it the one IP that you want.

(Don't forget to chmod 755 it! :) )

John
 
Ok, then I still have 2 questions,

what should be in the script if you want to add a line, like webmail.domain.com

and how can I change it for al the domains we have?
 
Hello,

In the /usr/local/directadmin/scripts/custom/domain_create_post.sh, type:
Code:
#!/bin/sh

echo "webmail   14000   IN   A   1.2.3.4" >> /var/named/${domain}.db;

exit 0;
That line will add webmail to each new domain.

To add it to all domains now, just create a script
Code:
#!/bin/sh

for i in `ls /var/named/*.db`; do
{
    echo "webmail   14000   IN   A   1.2.3.4" >> $i
};
done;

exit 0;
Then chmod the file to 755, and run it. Note that if you run it more than once, it will add the record more than once :) .. and if "webmail" already exists, it will be duplicated.

John
 
And what would the fix script look like? :D

A script that removes duplicates or all the webmail subdomains per example
 
Hehehe,

Well, the easiest way, would be to just have it remove all the webmail records, and then just run the previous script again so that it adds it.
to remove webmail records:
Code:
#!/bin/sh

for i in `ls /var/named/*.db`; do
{
     STR="/usr/bin/perl -pi -e 's/^webmail.*//'  /var/named/${i}"
     eval $STR
};
done;

exit 0;
Then run the other script to add them again.

John
 
Back
Top