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

@IPNAME

Discussion in 'Support' started by Joe Caverly, Jun 17, 2014.

  1. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    676
    Likes Received:
    8
    I am using;
    Code:
    TCC  16.02.48  Windows Vista [Version 6.0.6002]
    TCC Build 48  Windows Vista Build 6002  Service Pack 2
    Yes, I know a new build is available, and I will update to it.

    In Windows Explorer, I can see the name of my iTouch as jlc's iPod. It has an IP Address of 192.168.1.100 on my LAN.

    In Windows Explorer, I can see the name of my Android Phone, SGH-T986D. It has an IP Address of 192.168.1.102 on my LAN.

    When I log into my wifi modem at 192.168.1.1, it shows these devices with their names as in Windows Explorer (Host Name), along with their IP Addresses, and MAC addresses.

    (NOTE: My WiFi Modem allows a maximum of 5 connections, from 192.168.1.100 to 192.168.1.104)

    Note the following ouput:
    Code:
    echo %@ipname[192.168.1.1]
    mobilewifi.home
    
    echo %@ipname[192.168.1.100]
    11004
    
    echo %@ipname[192.168.1.101]
    Optiplex9601
    
    echo %@ipname[192.168.1.102]
    11004
    192.168.1.1 gives the correct name, as does 192.168.1.101 (my desktop computer). However, I get an error (The requested name is valid, but no data of the requested type was found.) for my iTouch and my Android Phone.

    @macaddress returns the correct MAC address of each device.

    Should @ipname be able to return the name of my iTouch and Android phone, or is this WAD?

    If WAD, does anyone know how to get the name of my iTouch and Android phone from TCC? Windows Explorer can, so there must be a way.

    Joe
     
  2. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,187
    Likes Received:
    11
    What does NSLOOKUP return? If it returns a valid name, you can use %@execstr[nslookup 192.168.1.100 | ffind /kmt"name:"]
     
  3. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    676
    Likes Received:
    8
    Code:
    nslookup 192.168.1.100
    Server:  mobilewifi.home
    Address:  192.168.1.1
    
    *** mobilewifi.home can't find 192.168.1.100: Non-existent domain
    Joe
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,935
    Likes Received:
    30
    11004 is an error code: "The requested name is valid, but no data of the requested type was found." a.k.a. "The destination protocol was unreachable". I'm pretty sure that @IPNAME requires some sort of DNS lookup.

    I imagine Explorer gets names by enumerating the network connections/devices. I don't think anything in TCC does that (could be wrong).

    You could hard-code the name/address pairs in your HOSTS and/or LMHOSTS files. **Maybe** @IPNAME would then work ... but that would be begging the question ... eh?

    Curious: Does "IPCONFIG /displaydns" show any of them?
     
  5. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    676
    Likes Received:
    8
    Vince, adding the IP Address and name to my HOSTS file worked. @IPNAME now returns the name of my devices. Thanks.

    Code:
    ipconfig /displaydns
    
    Windows IP Configuration
    
    Could not display the DNS Resolver Cache.
    Joe
     
  6. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,935
    Likes Received:
    30
    Did you stop the Dnscache service? I'm a big fan of not having unnecessary services running but that's one which I figure speeds up network performance so I leave it alone.

    With HOSTS you can also give aliases to hosts. With LMHOSTS you can give a name to a connection that doesn't have one. Lucky.syr.edu is my computer at work; it's also at the other end of a VPN that allows me to do all sorts of Windows stuff. I have:
    Code:
    v:\> type s:\drivers\etc\hosts | grep -v #
    128.230.13.36  lucky.syr.edu  ilucky
    169.254.1.1  lucky
    128.230.13.27  barnyard.syr.edu by
    129.6.13.35  www.time.gov
    128.230.37.187  newclock.syr.edu  clock.syr.edu
    
    v:\> type s:\drivers\etc\lmhosts | grep lucky
    169.254.1.1  lucky  #PRE
    128.230.13.36  ilucky  #PRE
    They allow the likes of:
    Code:
    iftp "ftp://ilucky"
    iftp "ftp://lucky"
    cdd \\lucky\d$
    dir \\lucky\c$\Windows[CODE]
    not to mention Explorer (but sadly, not TCMD) being able to instantly open windows for folders on "lucky".
     
  7. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,854
    Likes Received:
    83
    @IPNAME uses DNS to resolve host names & addresses.
     
  8. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    676
    Likes Received:
    8
    Microsoft has a utility, with full C++ Source Code, called USBView, available from;

    http://code.msdn.microsoft.com/windowshardware/USBView-sample-application-e3241039#content

    As I do not "C++", it will take me some time to read through the source code, but this program does what I need, which is, tell me the name of the attached device, along with other useful information, such as Last Plug/Unplug Date.

    This information may be useful to others via a plugin, if someone is so inclined.

    Joe
     

Share This Page