Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2004
    Location
    Finchley, London
    Posts
    9

    Domain resolving script

    Hi

    Does anyone know where I can get a script to run on the server that tells me which domains still resolve to the server and which domains point elsewhere so i can remove them

    Thanks

    Del
    1stChoiceWebHost.co.uk
    Budget Website Hosting and
    Supplier of E W Portal 1.7DC

  2. #2
    Join Date
    Aug 2004
    Location
    Orlando
    Posts
    1,280
    Have you checked hotscripts.com?

    http://www.hotscripts.com/search/13338611.html
    eVerity.com
    Celebrating 9 years of customer service. Domain names, shared/semi-dedicated/dedicated hosting, SSL certificates, merchant accounts, reseller options, and referral program, since July 2000.

  3. #3
    Join Date
    Nov 2003
    Location
    UK
    Posts
    177
    try http://www.programmingtalk.com/
    theres a script request section, someone there might be able to help you

  4. #4
    Join Date
    May 2006
    Location
    Teh Interweb
    Posts
    314
    What operating system are you running? Do you have a control panel?

    [theBleeber@wht01] ~ $ cat .signature
    cat: .signature: No such file or directory

  5. #5
    Join Date
    Aug 2005
    Location
    Canada
    Posts
    862
    It will read the list of hosts form a file named 'hl'
    and output the host that caused an error in 'badhosts'

    The first echo and exec 2>&1 is for running as CGI and for debugging.
    Code:
    #!/bin/sh
    #echo
    #exec 2>&1
    
    while read -r h
    do
     host "$h" || echo "$h" >>badhosts
    done <hl
    PS. If you want to check if the hostnames resolve to specific IP address or not, you can do like this, I guss.
    (Not tested)
    Code:
    #!/bin/sh
    #echo
    #exec 2>&1
    
    # the IP 
    IP="123.123.123.123"
    
    while read -r h
    do
     case `host "$h"` in
       *$IP*) ;;
       *)  echo "$h" >>badhosts;;
     esac
    done <hl
    Last edited by extras; 12-20-2006 at 02:18 AM.

  6. #6
    Join Date
    May 2006
    Location
    Teh Interweb
    Posts
    314
    If you use a script such as this, you will want to ensure you are running it against external resolvers. If you host it against the same DNS server they will all return true.

    [theBleeber@wht01] ~ $ cat .signature
    cat: .signature: No such file or directory

  7. #7
    Join Date
    Aug 2005
    Location
    Canada
    Posts
    862
    Oh, it's true if he runs it on the server using the same DNS.
    I didn't think about that. Thank you.

    Well, I guess he can edit resolv.conf, or use "dig" with @ns.whatever.com instead of "host".

    Probaby, it's better to use Perl or other language, if there are lots of hosts to check ...

  8. #8
    Join Date
    May 2006
    Location
    Teh Interweb
    Posts
    314
    I only know because I have done it before.

    [theBleeber@wht01] ~ $ cat .signature
    cat: .signature: No such file or directory

  9. #9
    We run a simple PHP script that checks the actual nameservers (since all customers on our servers are on our specific nameservers) on a list of domains from the relevant whois. Not overly clever - but effective.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •