View Full Version : change standard DNS settings
bvvelzen
11-19-2003, 06:21 AM
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,
nobaloney
11-19-2003, 09:03 AM
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
bvvelzen
11-20-2003, 06:02 AM
Originally posted by jlasman
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.
DirectAdmin Support
11-20-2003, 10:49 AM
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:
#!/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
bvvelzen
12-04-2003, 06:52 AM
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?
DirectAdmin Support
12-04-2003, 12:34 PM
Hello,
In the /usr/local/directadmin/scripts/custom/domain_create_post.sh, type:
#!/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
#!/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
interfasys
12-22-2003, 12:48 PM
And what would the fix script look like? :D
A script that removes duplicates or all the webmail subdomains per example
DirectAdmin Support
12-23-2003, 10:32 AM
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:
#!/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
interfasys
12-23-2003, 05:10 PM
Added to my toolbox :D, thanks!
Powered by vBulletin™ Version 4.0.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.