BIND question


 
Thread Tools Search this Thread
Special Forums IP Networking BIND question
# 1  
Old 10-12-2005
Question BIND question

Suppose you had a bunch of domains registered with names following the scheme, 11example.com 22example.com 33example.com etc. These domains are all for virutal webhosting, and will have the same web servers with the same IPs on all of them.

The question is, because they're 2nd level domains, is there any easy way to template the addresses in BIND, or am I going to have to have a separate /etc/named.conf entry for each domain? I tried putting them all in a 'zone "com" IN {}' and of course that broke pretty much everything else.

Thanks,
-V
# 2  
Old 10-16-2005
you can use different file for every domain
in named.conf

Code:
include "/etc/namedb/master.conf";

i use this script to make what i have to include
you can modify to use different files for each domain

cat genmaster

Code:
#!/usr/bin/perl

opendir D, "/etc/namedb/master/" or die 'anyad';
close STDOUT;
open STDOUT, ">/etc/namedb/master.conf";

while ($f=readdir(D)) {
        if ($f =~ /^db\./) {
        $f =~ s/^db\.//;
print <<EOF
zone "$f" {
     type master;
     file "master/db.$f";
};
EOF
        }
}

close STDOUT;
closedir D;

# 3  
Old 10-17-2005
Interesting -- how do you deal with slave servers?
# 4  
Old 10-18-2005
secondary

Code:
#!/usr/bin/perl


opendir D, "/etc/namedb/master/" or die 'anyad';
while ($f=readdir(D)) {
        if ($f =~ /^db\./) {
        $f =~ s/^db\.//;
print <<EOF
zone "$f" {
        type slave;
        file "slave/bak.$f";
        masters {
                195.228.157.214;
        };
};
EOF
        }
}
close STDOUT;
closedir D;

u can use it genslave >slave.conf
then u have a slave.conf file, what you can include on slave szervers

thats all
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Bind

Hi All I need to do bind of exiting filesystem to new storage allocated mount --bind /prod/OpenCSS /var/lib/test echo "/prod/OpenCSS /var/lib/pgsql bind bind 0 0" >> /etc/fstab will this command just work ? (2 Replies)
Discussion started by: anil529
2 Replies

2. IP Networking

Solaris BIND question

I have three Solaris DNS servers, a master & two secondaries. On the master, There is an A record for one of my secondaries with an IP that is different from that servers physical IP address. There is also a corresponding PTR record for the same server & IP. I am trying to figure out what the... (1 Reply)
Discussion started by: woodwre
1 Replies

3. IP Networking

Newbie BIND DNS question: resolving upstream hosts?

Old skool UNIX and Linux geek here, but newbie to the world of DNS and bind. I've recently been tasked with replacing our DNS infrastructure, currently on Windows, with a RHEL based solution. And I assume that means using bind, which I've not used before. Here's my question: Suppose our company... (3 Replies)
Discussion started by: lupin..the..3rd
3 Replies

4. UNIX for Dummies Questions & Answers

Can't bind to IP

When you get the message can't bind to ip already in use. is there a command to search to see everything that is using that IP? I've already check the host and hostname files (2 Replies)
Discussion started by: mchelle_99
2 Replies

5. Solaris

Solaris 8 bind 9 named question

Hi, I can't rememeber what passwd is set for the "named" user in bind. Is there possibly a default one or anyway to find it ? I'm worried about changing it and causing other issues, if I did change it what other files would I need to edit ? :( Thanks (1 Reply)
Discussion started by: sysop400
1 Replies

6. UNIX for Advanced & Expert Users

Bind failure

Hi all, I am using Perl program to do socket communication. My application has to use port 40001 this is a condition I can't change the port. The execution of this script always gave an error 'Bind failure port already in use' netstat execution gives below line: udp 0 0 ... (5 Replies)
Discussion started by: zing_foru
5 Replies

7. IP Networking

Question on DNS/BIND

I have set up a BIND server running on Redhat AS 3.0 and the question I have is that I can point my laptop to that server and resolve all the hosts I have put in my .zone file but for the life of me I can resolve any outside information. I have verified the server can talk to the world. Any hints... (2 Replies)
Discussion started by: Acleoma
2 Replies

8. UNIX for Dummies Questions & Answers

DNS/BIND question, is it ze germans?

First some back ground info: I am working on a computer running SuSE 7.3 I am still trying to set up a DNS I downloaded BIND 9.2.1 and was following a tutorial about BIND. It said at virtually the start of the tutorial that I should find a file called named.conf in my /etc directory. Yes, I... (1 Reply)
Discussion started by: ignus7
1 Replies

9. IP Networking

bind() error

Hello. I am havig problems with this program. It is a server supposed to get 2 integers from client, calculate a sum and send result back to client. I am getting a bind() error when attempting to execute it. Any help appreciated #include <stdio.h> #include <sys/types.h> #include... (2 Replies)
Discussion started by: Virtuosso
2 Replies
Login or Register to Ask a Question