Adding Extra Lines

ReN

Verified User
Joined
Jul 2, 2005
Messages
172
Greetings guys,

I'm looking for a command to do the following

for example

inside a dns record is

mail IN A x.x.x.1
ftp IN A x.x.x.1

i want to add the line globally to all dns records

mail IN A x.x.x.2

so it looks like

mail IN A x.x.x.1
mail IN A x.x.x.2
ftp IN A x.x.x.1
 
I know that you can edit the dns template for A records by doing the following

Code:
cd /usr/local/directadmin/data/templates
cp dns_a.conf custom
cd custom
vi dns_a.conf

You would then have to edit the template file accordingly to add the code in. This would be for new domains that are added to your control panel. I do not think that there is a dns rewrite command though to accept the new changes you might have to edit the files manually.

The only way I would know how to do it is the following:

Code:
At the root shell you can run this

for i in /etc/namedb/*.db; do echo "mail IN A x.x.x.2" >> $i; done


Then run

/sbin/service named restart

You will have to edit that line in 2 places.

1. change the /etc/namedb to the correct directory for linux. I am a freebsd user so I do not know where the dns files are kept for linux.

2. change x.x.x.2 to the right ip address that you wish to add
 
The way we made a similar change was to move the required template files to the custom directory, then run the rewrite command.

If I recall correctly, this worked, and also works for new domains.

Jeff
 
Arhhh nice , was just making sure , thanx again for everyoens input on this one.
 
Back
Top