FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 09-24-2010, 05:49 PM
"James A. Peltier"
 
Default Configuring BIND to answer to two domain names (four IP addresses)

----- Original Message -----
| > Have a read for the listen on directive for BIND which tells BIND
| > what
| > interfaces/IP Addresses to bind to.
|
| Thanks, I am aware that Apache can be told to listen only to specific
| addresses. Can BIND be told to listen on all addresses? Your post
| implies that this is the default (which makes sense, as so does
| Apache), maybe I am chasing a non-issue?
|
| In other words, I should configure BIND to answer to exampleA.com and
| to exampleB.com with no regard to IP addresses. then in the control
| panel for each domain name configure the nameservers to my liking
| (with addresses that the server answers to, naturally)? That's it?
|
|
| > *Alternatively, you could just configure BIND identically on both
| > *machines and ensure that
| > they are setup in a master/slave configuration so that each name
| > server could answer
| > requests for both domains and publish both name server records in
| > each domain.
| >
|
| There is only one machine. All four addresses point to it.
|
| --
| Dotan Cohen
|
| http://gibberish.co.il
| http://what-is-what.com
| _______________________________________________
| CentOS mailing list
| CentOS@centos.org
| http://lists.centos.org/mailman/listinfo/centos


BIND has listen on directives as well, but if this is a single box configuration it's not necessarily required as it will listen on all interfaces.

As far as configuring the domains, well that's pretty simple. In your DNS records for each domain you would define NS records such as this

$TTL 1d
@ IN SOA ns1.exampleA.com. hostmaster.exampleA.com. (
2010092401 ; PUT SEQUENCE NUMBER HERE (YYYY/MM/DAY/CHANGE #)
3600 ; Refresh every hour
600 ; Retry - every ten minutes
604800 ; Expire - after one week
1h ) ; Minimum 1H
IN NS ns1.exampleA.com.
IN NS ns2.exampleA.com.

;; Hosts Section

ns1 IN A 1.1.1.1
ns2 IN A 1.1.1.2
www IN A 1.1.1.3

Keep in mind that you don't need A records for the NS records if you are pointing to a different name server so your exampleB your records might look like this


$TTL 1d
@ IN SOA ns1.exampleB.com. hostmaster.exampleB.com. (
2010092401 ; PUT SEQUENCE NUMBER HERE (YYYY/MM/DAY/CHANGE #)
3600 ; Refresh every hour
600 ; Retry - every ten minutes
604800 ; Expire - after one week
1h ) ; Minimum 1H
IN NS ns1.exampleA.com.
IN NS ns2.exampleA.com.

;; Hosts Section

www 1.1.1.4

Notice that the NS records point to ns1 and ns2.exampleA.com.

Notice the A records for www.example{A,B} which should match your Apache instances if you are doing IP based hosting. If you are doing name based hosting you *could* DNS round robin the requests.

Master and Secondary DNS configurations are defined in your named.conf file. This doesn't matter in your necessarily for your configuration, but thought I would point it out.


On the master

zone "examplea.com" {
type master;
file "zone.examplea.com";
allow-transfer { ns2.examplea.com }
};


On the secondary

zone "examplea.com" {
type slave;
masters { ns1.examplea.com };
file "zone.example.com";
};


--
James A. Peltier
Systems Analyst (FASNet), VIVARIUM Technical Director
Simon Fraser University - Burnaby Campus
Phone : 778-782-6573
Fax : 778-782-3045
E-Mail : jpeltier@sfu.ca
Website : http://www.fas.sfu.ca | http://vivarium.cs.sfu.ca
MSN : subatomic_spam@hotmail.com

Does your OS has a man 8 lart?
http://www.xinu.nl/unix/humour/asr-manpages/lart.html


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 09-24-2010, 08:06 PM
"James A. Peltier"
 
Default Configuring BIND to answer to two domain names (four IP addresses)

----- Original Message -----
| Thank you for all the help so far. To conclude:
| I have one physical server that answers to the following IP addresses:
| 1.1.1.1
| 1.1.1.2
| 1.1.1.3
| 1.1.1.4
|
| I need 1.1.1.1 & 1.1.1.2 to be the name servers for exampleA.com, and
| 1.1.1.3 & 1.1.1.4 to be the nameservers for exampleB.com. I have these
| files:
|
| # cat /etc/named.conf
|
| options {
| directory "/etc";
| pid-file "/var/run/named/named.pid";
| listen-on {
| any;
| };
| };
|
| zone "." {
| type hint;
| file "/etc/db.cache";
| };
|
| zone "exampleA.com" {
| type master;
| file "/var/named/exampleA.com.hosts";
| };
| zone "exampleB.com" {
| type master;
| file "/var/named/exampleB.com.hosts";
| };
|
|
|
| # cat /var/named/exampleA.com.hosts
|
| $ORIGIN exampleA.com.
| $TTL 1h
| exampleA.com. IN SOA ns1.exampleA.com. ns2.exampleA.com. (
| 1; Serial - increment me
| 10800
| 3600
| 604800
| 38400 )
| exampleA.com. IN NS ns1.exampleA.com.
| exampleA.com. IN NS ns2.exampleA.com.
| exampleA.com. IN A 1.1.1.1
| exampleA.com. IN A 1.1.1.2

formatting for NS records is incorrect. It should just read

NS ns1.exampleA.com
NS ns2.exampleA.com

where is your ns1.exampleA.com entry?
where is your ns2.exampleA.com entry?


| # cat /var/named/exampleB.com.hosts
|
| $ORIGIN exampleB.com.
| $TTL 1h
| exampleB.com. IN SOA ns1.exampleB.com. ns2.exampleB.com. (
| 1; Serial - increment me
| 10800
| 3600
| 604800
| 38400 )
| exampleB.com. IN NS ns1.exampleB.com.
| exampleB.com. IN NS ns2.exampleB.com.
| exampleB.com. IN A 1.1.1.3
| exampleB.com. IN A 1.1.1.4

NS records are same as above. Correct your formatting.

A records are not needed for NS records from a different zone, only for that zone

| How does that look?

Broken!

--
James A. Peltier
Systems Analyst (FASNet), VIVARIUM Technical Director
Simon Fraser University - Burnaby Campus
Phone : 778-782-6573
Fax : 778-782-3045
E-Mail : jpeltier@sfu.ca
Website : http://www.fas.sfu.ca | http://vivarium.cs.sfu.ca
MSN : subatomic_spam@hotmail.com

Does your OS has a man 8 lart?
http://www.xinu.nl/unix/humour/asr-manpages/lart.html


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 09-24-2010, 09:13 PM
"James A. Peltier"
 
Default Configuring BIND to answer to two domain names (four IP addresses)

----- Original Message -----
| On Fri, Sep 24, 2010 at 22:41, Robert Heller <heller@deepsoft.com>
| wrote:
| > You need:
| >
| > ns1.exampleA.com. IN A 1.1.1.1
| > ns2.exampleA.com. IN A 1.1.1.2
| >
|
| Here I have found conflicting information, it seems that some sources
| suggest this instead:
| ns1 IN A 1.1.1.1
| ns2 IN A 1.1.1.2
|
| Any idea?
|
| > And you might also consider:
| >
| > www.exampleA.com. IN A 1.1.1.1
| > www.exampleA.com. IN A 1.1.1.2
| >
|
| Yes, of course! Thanks.
|
| --
| Dotan Cohen
|
| http://gibberish.co.il
| http://what-is-what.com
| _______________________________________________
| CentOS mailing list
| CentOS@centos.org
| http://lists.centos.org/mailman/listinfo/centos


This is a matter of preference, but may depend on your configuration too. I'm lazy so I use short form

http://www.zytrax.com/books/dns/ch6/mydomain.html


--
James A. Peltier
Systems Analyst (FASNet), VIVARIUM Technical Director
Simon Fraser University - Burnaby Campus
Phone : 778-782-6573
Fax : 778-782-3045
E-Mail : jpeltier@sfu.ca
Website : http://www.fas.sfu.ca | http://vivarium.cs.sfu.ca
MSN : subatomic_spam@hotmail.com

Does your OS has a man 8 lart?
http://www.xinu.nl/unix/humour/asr-manpages/lart.html

--
--
James A. Peltier
Systems Analyst (FASNet), VIVARIUM Technical Director
Simon Fraser University - Burnaby Campus
Phone : 778-782-6573
Fax : 778-782-3045
E-Mail : jpeltier@sfu.ca
Website : http://www.fas.sfu.ca | http://vivarium.cs.sfu.ca
MSN : subatomic_spam@hotmail.com

Does your OS has a man 8 lart?
http://www.xinu.nl/unix/humour/asr-manpages/lart.html


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 09-24-2010, 09:29 PM
"James A. Peltier"
 
Default Configuring BIND to answer to two domain names (four IP addresses)

----- Original Message -----
| All right, I think this should do it:
|
| $ORIGIN exampleA.com.
| $TTL 86400
| exampleA.com. IN SOA ns1.exampleA.com. ns2.exampleA.com. (
| 2; Serial - increment me
| 10800
| 3600
| 604800
| 38400 )
| IN NS ns1.exampleA.com.
| IN NS ns2.exampleA.com.
| IN A 178.63.65.136
| IN A 178.63.65.188
| www IN A 178.63.65.136
| www IN A 178.63.65.188
| ns1 IN A 178.63.65.136
| ns2 IN A 178.63.65.188
|
| What say the wise among us?
|
| --
| Dotan Cohen
|
| http://gibberish.co.il
| http://what-is-what.com
| _______________________________________________
| CentOS mailing list
| CentOS@centos.org
| http://lists.centos.org/mailman/listinfo/centos

Looks good. you can change your 10800 3600 604800 and 38400 to hours, days or weeks represented by 1h, 1d or 1w respectively to make it easier than calculating seconds.


--
James A. Peltier
Systems Analyst (FASNet), VIVARIUM Technical Director
Simon Fraser University - Burnaby Campus
Phone : 778-782-6573
Fax : 778-782-3045
E-Mail : jpeltier@sfu.ca
Website : http://www.fas.sfu.ca | http://vivarium.cs.sfu.ca
MSN : subatomic_spam@hotmail.com

Does your OS has a man 8 lart?
http://www.xinu.nl/unix/humour/asr-manpages/lart.html


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 03:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org