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.

remove all rr added by cpanel at update

Discussion in 'Bind / DNS / Nameserver Issues' started by kjg, Jan 22, 2016.

  1. kjg

    kjg Well-Known Member

    Joined:
    Mar 2, 2004
    Messages:
    147
    Likes Received:
    0
    Trophy Points:
    16
    Hi
    Just realised that all zones in the different nameservers we run on cpanel servers have got a number of extra records added after an (earlier) upgrade. Records such as:
    cpcalendars IN A xx.xxx.xxx.xxx
    cpcontacts IN A xx.xxx.xxx.xxx
    ...

    How can we get rid of these added records? They are not in our templates and we do not use them.

    Would be very nice if this type of things were not added automatically...

    Are there any tools/scripts for this provided by cPanel?

    A script looping through all zones and deleting the rows for cpcalendars, cpcontacts would be nice. Guess it would also have to update serial ...

    Suppose it could be done via API, but with many thousands of Zones this will take a lot of time I guess

    //
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,472
    Likes Received:
    200
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. kjg

    kjg Well-Known Member

    Joined:
    Mar 2, 2004
    Messages:
    147
    Likes Received:
    0
    Trophy Points:
    16
    Thank you for the quick reply, but I am not sure I understand the reply. I reread the release doc and cant find anything in it that helps me. It only say that there is now support for CalDAV and CardDAV. Cant find that it say anywhere that it will add rows to all zones in name servers (regardless of those zones being for actual accounts or not). Adding support for CalDAV and CardDAV when it comes as a new feature should be done by choise from us, not by surprise... (but this is another discussion and there are threads about that already)

    I can't see anything in the docs you linked to, that can help me getting rid of all those lines added.

    I found a couple of old scripts I have used earlier plus some in the forum and guess I could just:

    Code:
    First a backup
        cp -a /var/named /var/named-backup
    
    Then remove the lines including cpcalendars (and other unwanted lines)
       find /var/named/*.db -exec sed --in-place '/cpcalendars/d' "{}" ';'
    
    Then change serial
         find /var/named/*.db -exec perl -pi -e 'if (/^\s+(\d{10})\s+;\s+serial/i) { my $i = $1+1; s/$1/$i/;}' '{}' \;
    
    and restart named
    
    
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,472
    Likes Received:
    200
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I can't help you with your primary question or script, I responded to your comment about not using it with details as to what it is. You might not use now, but you might if you knew what it is. Assuming you do know and need a way to remove what you need to, I'll leave the help for that to someone else.

    Sorry I can't help more.
     
Loading...

Share This Page