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

Whois.btm - Look up an IP address

Discussion in 'T&T - Scripting' started by nchernoff, Jun 4, 2008.

  1. nchernoff

    nchernoff Administrator
    Staff Member

    Joined:
    May 16, 2008
    Messages:
    42
    Likes Received:
    2
    Migrated From JP Software Wiki

    whois.btm looks up an IP address and displays the URL.

    Usage: whois 11.22.33.44
    Displays: 11.22.33.44 = xyz12.sample.com

    Code:
    :  whois.btm
    :  Run whois and display URL
    :  by Joseph "Rick" Reinckens
    :  Usage: whois IP_address
    
    @echo off
    setlocal
    
    if not "%1"=="" goto get_it
    echo *** IP address parameter needed ***
    goto done
    
    :get_it
    set ipname=%@ipname[%1]
    if not "%ipname"=="11004" goto show_it
    echo *** No IP address found ***
    goto done
    
    :show_it
    echo %1 = %ipname
    
    :done
    endlocal
    
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    For reasons unknown, I the message below could not be delivered as a
    response to tc_tips@jpsoft.com:

    Steve Fabian wrote:
    | nchernoff wrote:
    || *whois.btm looks up an IP address and displays the URL.*
    |
    | Alternate, looks up as many as are in the command line:
    |
    | Code
    | ---------------
    | setlocal
    | do while %# GT 0
    | set url=%@ipname[%1]
    | echo %[1]%@if[%url EQ 11004, *** no IP address ***,=%url]
    | shift
    | enddo
    | ---------------
    | Steve
     
  3. dim

    dim Dimitry Andric

    Joined:
    May 31, 2008
    Messages:
    203
    Likes Received:
    0
    Same here:

    Code:
    Final-Recipient: rfc822; tc_tips@jpsoft.com
    Original-Recipient: rfc822;tc_tips@jpsoft.com
    Action: failed
    Status: 5.1.1
    Remote-MTA: dns; spam.apollohosting.com
    Diagnostic-Code: smtp; 550 5.1.1 <tc_tips@jpsoft.com>... User unknown
    
    In my case, the reply was:

    On 2008-06-04 21:26, nchernoff wrote:
    > *whois.btm looks up an IP address and displays the URL.*
    >
    > Usage: whois 11.22.33.44
    > Displays: 11.22.33.44 = xyz12.sample.com

    You shouldn't call this "whois", because that is a completely different
    service. You're simply doing reverse DNS lookups.
     
  4. gwgaston

    gwgaston Senior IT Security Consultant

    Joined:
    May 28, 2008
    Messages:
    40
    Likes Received:
    1
    Correct. Also for what the is doing you could use my old resolve plugin too:
    HTML:
    http://itservicepro.com/download/Resolve-4NTPlugin.zip
     
  5. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,201
    Likes Received:
    11
    Doesn't the utility NSLOOKUP also do this same thing? NSLOOKUP comes with
    all Win2K and later Win-OSen.

    -Scott

    "JP Software Forums" <neil@jpsoft.com> wrote on 10/17/2008 10:06:22 AM:


    itservicepro.com/download/Resolve-4NTPlugin.zip
     
  6. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    JP Software Forums" <neil@jpsoft.com>; "gwgaston wrote:
    | ---Quote (Originally by dim)---
    |
    | On 2008-06-04 21:26, nchernoff wrote:
    || *whois.btm looks up an IP address and displays the URL.*
    ||
    || Usage: whois 11.22.33.44
    || Displays: 11.22.33.44 = xyz12.sample.com
    |
    | You shouldn't call this "whois", because that is a completely
    | different
    | service. You're simply doing reverse DNS lookups.
    | ---End Quote---
    |
    | Correct. Also for what the is doing you could use my old resolve
    | plugin too:

    Or the built-in function @ipname[]
    --
    Steve
     
  7. gwgaston

    gwgaston Senior IT Security Consultant

    Joined:
    May 28, 2008
    Messages:
    40
    Likes Received:
    1
    Yes, his wrapper batch file uses @ipname so that is obvious. Resolve just adds a little more "smarts" than his wrapper.
     
  8. gwgaston

    gwgaston Senior IT Security Consultant

    Joined:
    May 28, 2008
    Messages:
    40
    Likes Received:
    1
    NSLOOKUP is strickly DNS, which likely is fine for most things but resolve (as well as ipname) will work with whatever other name resolution your setup supports. For instance a static entry in your hosts file.

    Also my reply was more about wrapper part which resolve expands on:

    resolve http://jpsoft.com/forums/showthread.php?t=127
    66.242.19.217

    resolve 66.242.19.217
    jpsoft.com

    %@if["%@resolve[66.242.19.217]" EQ "jpsoft.com",Yes,No]
    Yes

    But then I have to support thousands of PCs and resolve is useful enough to load as a plugin for me. Likely not so for most people.

    EDIT: I gotta say this is some sucky forum software.
     

Share This Page