Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    166
    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,574
    Likes Received:
    3
    Trophy Points:
    343
    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
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. jeroman8

    jeroman8 Well-Known Member

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

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice