0

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]
siliconpi
  • 1,807
  • 6
  • 32
  • 46
  • "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 02 '12 at 03: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) – siliconpi Jan 02 '12 at 03:27
  • @SidB It's having an issue loading `domain2.com.zone`. Please provide the contents of that file. – Shane Madden Jan 02 '12 at 03: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 02 '12 at 04: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 02 '12 at 04:46
  • @fbh Where are you seeing a failure on the `domain1.com.zone` file? Not specifying a TTL is odd, but not a failure. – Chris S Jan 02 '12 at 04:48
  • @Chris, I am aware that it is only a warning. I do believe though, that having both zone files shown here will help us give Sid the better help in understanding what's wrong and why this warning is showing (and how to fix it). If I log on to a server at work, I usually fix warnings too if possible, not just the critical errors :) – Frands Hansen Jan 02 '12 at 04:51
  • Not sure I understand the negative vote there, but thanks Chris, Shane, fbh for your insight into domain2.com.zone being messed up - that helped me diagnose the actual issue. – siliconpi Jan 02 '12 at 15:25

1 Answers1

1

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;};
};
siliconpi
  • 1,807
  • 6
  • 32
  • 46