1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need to delete all 'DNS Only' Zones

Discussion in 'Bind / DNS / Nameserver Issues' started by MantisComp, Dec 19, 2009.

  1. MantisComp

    MantisComp Member

    Joined:
    Oct 16, 2008
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Hi
    I need to remove all know DNS Zones on my 'DNS Only' server as they have become out of sync with a new cPanel server.
    Any ideas how I can remove/purge all zones?

    Thanks
    Rob
     
  2. madaboutlinux

    madaboutlinux Active Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    Try the following on the command prompt:

    for i in `ls -la /var/named/*.db | sed s'/\.db//g' | awk '{print $9}' | cut -d/ -f4`do /scripts/killdns $i done;
     
  3. MantisComp

    MantisComp Member

    Joined:
    Oct 16, 2008
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Thanks, I tried that but end up with a '>' prompt and nothing happens.
    I have to press 'ctrl + c' to return to and normal 'root@ns2 [~]#' prompt.
    Am I doing something wrong?
     
  4. madaboutlinux

    madaboutlinux Active Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    Ok, do one thing, execute each line as I gave you and hit enter

    You will see a '>' sign once you type the first 'for..' line and hit enter, but continue to execute the commands as given above.
     

Share This Page