Question:

How would I edit a zone file?

by  |  earlier

0 LIKES UnLike

I have a site adcaustin.com

its remotely hosted now.

and am running a dns server locally

and a mail server and other sites.

how do I edit my zone file to point to the remote location when pulling up adcaustin.com

the remote location is adctest.dreamhosters.com

 Tags:

   Report

2 ANSWERS


  1. In Linux, the zone files are often kept in the folder /var/named but your server could be configured differently. To be sure, open /etc/named.conf and see where it says they are, and the name of the file for your zone adcaustin.com

    Inside the zone file, there are some key elements to edit.

    Your hostname will be either an A record, or a CNAME record.

    eg:

    adcaustin.com.  A  72.101.69.12  (or whatever the IP is)

    adcaustin.com. CNAME www.hostingcompany.com.

    note the trailing periods in the names! If you don't supply them, then bind will append the domain name to the end of them.

    e.g.:

    www  A  72.101.69.12  ==> (www.adcaustin.com)

    After making any changes to a zone file, there is one more spot that needs to be updated: the SOA record, usually at the beginning of the file. You will see a series of numbers, usually with comments telling you what they are. The first one is the zone's serial number. This tells any slave DNS servers what the most recent version of your zone is. If you don't update this, then slave servers will not get your changes.

    The de-facto standard of the serial is yyyymmddnn (where nn is two digits left for you to increment after multiple changes on the same day)

    So if you made two changes today, your serial number would end up being 2008082502. In truth, the new serial only has to be higher than the old, but folks like to use it as a sort of timestamp, as you can see.

    Once the changes are made, you need to restart bind.

    On redhat, and similar systems, you can issue the command, "service named restart" and that usually takes care of it. If not, you can find the pid of bind by using the command "ps -ef | grep named" - the PID number is the second item in the list. Issue the command "kill -HUP <pid#>" and it's done.

    If you need further assistance, feel free to email me. I've been running BIND-based DNS servers since 1996.

    EDIT:

    After re-reading your problem description, I would recommend that you use a CNAME in stead of an A-record. the hosting company may shuffle the IP addresses of their servers around occasionally, and a CNAME will follow whatever they put in their own DNS.

    So your entry in the zone file would look like this:

    www     IN CNAME   adcaustin.com.  ;trailing period!!

    adcaustin.com. IN CNAME adcaustin.com.

    I've had trouble with resolving the domain name itself using CNAMEs so if your version of bind balks at this, use an A record in stead.


  2. idk  

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.