The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

old zone files wont update

Discussion in 'General Discussion' started by 4u123, Dec 11, 2007.

  1. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    Hi,

    One of our servers has a ton of out of date files in /var/named - all the IP addresses for the domains are wrong because they are showing details from before we moved the domains onto new servers.

    I cant see any problems with the bind installation and the server is set up in the DNS cluster correctly. The domains that are actually being run from that server are all fine, its all the other domains. I dont know why this server contains so many zone files - other servers just have the zone files for the domains that are run from that server.

    This is only causing a problem currently because I have the server set up as its own local resolver temporarily. Customers trying to send mail from that server to any other of our servers is bouncing because the local lookup is providing incorrect info.

    I've run "synchronize DNS records" in WHM and this has run successfully but the zone files are all still incorrect.

    Can anyone please advise what I need to do to make sure these are all updated correctly ?
     
    #1 4u123, Dec 11, 2007
    Last edited: Dec 11, 2007
  2. tweakservers

    tweakservers Well-Known Member

    Joined:
    Mar 30, 2006
    Messages:
    379
    Likes Received:
    0
    Trophy Points:
    16
    if you are running DNS cluster, it is very normal to see all the zones files from all your server shows up in every server in the cluster
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    If I'm reading your post correctly, you have a lot of Zones with the wrong IP Address(es) in them, correct? If that is true, then the solution is to change the IP Address(es) in the Zone file. Depending upon the number of Zones, and the number of IP Addresses involved, this can be done simply.

    Before doing anything, make certain you have a backup of the zones. Because mistakes are easy, I often make two copies, perform all my work on one of the copies, test the modified one and once satisfied the changes are correct and working, replace the production version with the working copy.

    With that said, with the problematic zone files, you need to perform a search and replace on them, replacing the wrong IP Address with the correct one. There are numerous methods of doing this. One such is:

    Code:
    ex -s -c :%s/192\.168\.1\.3/192.168.1.5/g -c :wq /var/named_backup/zone_test.db
    
    Substitute the correct IP Addresses for the example ones I used above. That will change the IP Address in one file. Make certain to escape the . character as I did, for safety sake. To update all files, this would work:

    Code:
    ex -s -c :%s/192\.168\.1\.3/192.168.1.5/g -c :wq /var/named_backup/*.db
    
    Ideally, the serials also need updated, in order to ensure the next sync that occurs preserves your changes. That can be a bit more complex, since likely the serials all vary.


    If it is only a few zones that need updated, you can use the Zone editor in WHM, which will update the serial along with your changes.
     
  4. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    Unfortunately its more complicated than that.

    A large number of the zone files on that server contain incorrect IP addresses. The zones for the domains hosted on the server are all correct. It is impossible for us to know what servers the incorrect domains are on without checking each one of them individually. There are 7000 so using a find / replace method is not possible.

    I dont understand how this situation arose.

    My questions are...

    1. Why dont they get updated via the cluster ? How could this situation have happened ?
    2. For each zone file is there always a corresponding entry in the named.conf onm each server?
    3. Is there an easy way of deleting the zone files for the domains that are not hosted on that server ?
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    OK, I hoped it wasn't complicated...

    If the serial number is that same on all members of the cluster, the zone won't get updated. it's possible this problem arose in the past since there have been some syncing issues since resolved in newer builds of cPanel 11 (and some still remain).

    There should be a corresponding entry in the named.conf file.

    The /var/cpanel/users files each contain a list of Domains associated with an account. The list is in the format DNS#=example.com with # representing an ever increasing number. . It will take some time and work, but a list can be composed from those entries and used to compare to the Zones on the server to determine which domain belongs on which server.
     
Loading...

Share This Page