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.

Script ? Find domains not pointing to server anymore

Discussion in 'General Discussion' started by jeroman8, Apr 2, 2005.

  1. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    Is there a script that can check all domains installed on a server which nameservers or DNS they use ? I have moved accounts from different servers and I'm a little confused now and need to get things sorted out. I can check dnsstuff and see where a domains goes but a scritp that does it for me would be nice :)
     
  2. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Here is a quick crude way of doing some checks.

    It uses the info in /etc/localdomains and gets the NS info for each domain listed. If anything it can be used as a starting point. Feel free to improve it.

    Code:
    for i in `cat /etc/localdomains`;do dig $i|grep NS|grep -v ROOT-SERVERS|grep -v ANSWER;done
    
    to pipe the results to a file

    Code:
    for i in `cat /etc/localdomains`;do dig $i|grep NS|grep -v ROOT-SERVERS|grep -v ANSWER>>domains.txt;done
    
     
  3. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    cool, thanks - it helped
     
Loading...

Share This Page