Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two domains registered with a registrar and a VPS with a hosting provider (separate).

I was able to get one of the domains accessible by adding the following to /etc/named.conf :

zone "domain1.com" in {
        type master;
        file "/var/named/domain1.com.zone";
};

However, I was not able to add another one? I have two IP addresses with the hosting provider.

I tried adding this, but it did not work:

zone "domain2.com" {
        type slave;
        file "/var/named/domain2.com.zone";
        masters { 12.34.56.78; };
};

As per Configuring two DNS zones with named.conf I tried this as well:

zone "domain1.com" in {
        type master;
        file "/var/named/domain1.com.zone";
        allow-transfer {12.34.56.78;12.34.56.79;};
};

zone "domain2.com" {
        type master;
        file "/var/named/domain2.com.zone";
        allow-transfer {12.34.56.78;12.34.56.79;};
};

This is CentOS.


Edit1

# /etc/init.d/named restart
Stopping named:                                            [  OK  ]
Starting named:
Error in named configuration:
/var/named/domain1.com.zone:2: no TTL specified; using SOA MINTTL instead
zone domain1.com/IN: loaded serial 2010082500
dns_rdata_fromtext: /var/named/domain2.com.zone:2: near eol: unexpected end of input
/var/named/domain2.com.zone:4: unknown RR type '600'
zone domain2.com/IN: loading master file /var/named/domain2.com.zone: unexpected end of input
_default/domain2.com/IN: unexpected end of input
                                                           [FAILED]
share|improve this question
    
"but it did not work" <-- And that helps us diagnose the problem how?? Have you checked the logs, getting an error, how did you come to the conclusion that it's not working? The section you have provided from your configuration file is the minimum configuration on the slave side, so you should be good there (assuming you've changed the IPs for privacy, if you literally used those IPs it's not going to work). Is the Master sever configured to allow transfers? –  Chris S Jan 2 '12 at 3:10
    
Hi Chris - are you saying that the second one should have worked? I'm testing via the browser where I use OpenDNS, but am also getting it to refresh its cache. That is showing SERVFAIL. And yes, the IP addresses are anonymized. When restarting named service it shows (see Edit1) –  matt74tm Jan 2 '12 at 3:27
    
@SidB It's having an issue loading domain2.com.zone. Please provide the contents of that file. –  Shane Madden Jan 2 '12 at 3:32
    
The config seems fine. Your zone files seems to be messed up, provide those (both of them) since it fails on both domain1.com and domain2.com –  Frands Hansen Jan 2 '12 at 4:43
    
The file /var/named/domain2.com.zone is corrupted on the slave, rename/move it and either reseed or let named pull it. You might want to check out what's in the file, it might give clues as to what went wrong. –  Chris S Jan 2 '12 at 4:46

1 Answer 1

up vote 1 down vote accepted

One single character out of place was causing this flare-up! Notice the opening-bracket!

In domain2.com.zone, I had:

; domain2.com
@                       IN SOA           ns1.domain2.com www.someotherdomain.com.
(
        2010082500      ; serial
        3600            ; refresh every 8 hours
        600             ; retry every 4 hours
        86400           ; expire 1000 hours
        3600            ; minimum 24 hours
)
...

whereas it should have been:

; domain2.com
@                       IN SOA           ns1.domain2.com www.someotherdomain.com. (
        2010082500      ; serial
        3600            ; refresh every 8 hours
        600             ; retry every 4 hours
        86400           ; expire 1000 hours
        3600            ; minimum 24 hours
)

It worked fine with the named.conf setup:

zone "domain1.com" in {
        type master;
        file "/var/named/domain1.com.zone";
        allow-transfer {12.34.56.78;12.34.56.79;};
};

zone "domain2.com" {
        type master;
        file "/var/named/domain2.com.zone";
        allow-transfer {12.34.56.78;12.34.56.79;};
};
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.