LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   bind9 zone file question (https://www.linuxquestions.org/questions/linux-software-2/bind9-zone-file-question-648377/)

r3gan 06-10-2008 04:57 PM

bind9 zone file question
 
Hi, I hope I have the correct forum for this question.

My question is about zone files in Bind9, or any DNS program I guess... with regard to the zone file syntax. Is it possible to have a zone file for a particular domain that does not contain any A records?

Here's an example:
Code:

$TTL 259200
example.com. IN SOA ns1.nameservers.com. postmaster.example.com. (
      2008061000      ; Serial
      259200          ; Refresh 3 days
      3600            ; Retry 1 hour
      1209600          ; Expire 2 weeks
      1800 )          ; Negative Cache TTL 30 minutes
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Name Servers
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      IN      NS      ns1.nameservers.com.
      IN      NS      ns2.nameservers.com.
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Aliases
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
www  IN      CNAME  www.someotherdomain.com.
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; End of File
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I assume in the above situation, a query to www.example.com would resolve to the same IP address as given to www.someotherdomain.com. Is this valid syntax for the domain zone file for example.com? It does not define any A records for the domain, and only lists one available domain (www.example.com) which is an alias to a totally different domain name. I'm wondering if this is allowed or if there are other "best practices" recommended.

Thanks!

Mr. C. 06-18-2008 03:47 PM

If you are setting up a zone example.com, then the name servers you list for the example.com would be on the system running the DNS server. Otherwise, you'd be setting up a zone, but indicating that some other DNS server is authoritative for the very zone you are configuring.

Your SOA record says that this DNS server is authoritative for example.com. Therefore, you need a name server in the example.com zone to handle authoritative queries. Thus, you will have at least one NS record, and it will require one A record.

r3gan 06-18-2008 04:23 PM

Yes, in my example, ns1.nameservers.com resolves to the exact same IP address. So given this, is my example then valid?

Mr. C. 06-18-2008 04:25 PM

How is ns1.nameservers.com to be resolved into an IP address ?

r3gan 06-18-2008 04:26 PM

There is another zone file on the same machine for nameservers.com, which has the host ns1.nameservers.com pointing to it's IP. Both the example.com and nameservers.com zone files would be on the same primary DNS server.

Mr. C. 06-18-2008 04:34 PM

In that case, as long as the name servers for the example.com zone are resolvable on the same BIND server, then your zone file above is fine.

r3gan 06-18-2008 05:49 PM

Yeah, both zone files example.com and nameservers.com are defined and reside on the exact same machine running Bind.

Thanks for your input, I wanted to check before changing some zone files to use the above syntax.


All times are GMT -5. The time now is 07:49 AM.