`
louisling
  • 浏览: 141401 次
  • 性别: Icon_minigender_1
  • 来自: ZhuHai
社区版块
存档分类
最新评论

Get machine name from IP

    博客分类:
  • Java
阅读更多
public static void main(String[] args) throws Exception {
    String addr = getMachineNameFromIP("192.168.1.159");
    System.out.println(addr);
}

static String getMachineNameFromIP(String ipAddr) {
    try {
        InetAddress i = InetAddress.getByName(ipAddr);
        return i.getHostName();
    } catch (UnknownHostException e) {
        e.printStackTrace();
        return "NULL";
    }
}
分享到:
评论

相关推荐

    win 3.11 for workgroup tcpip支持

    causes the name to be stored in the name cache when the machine is first initialized, so the name gets resolved without the driver having to open LMHOSTS at run time. IP Routing ---------- Multiple ...

    8-07-14_MegaCLI for linux_windows

    LSIP200233163 (DFCT) improve the manner and customer experience of transitioning from MR mode to iMR LSIP200233100 (DFCT) MR5.4 MegaCli - does not recognize the adapter LSIP200233107 (DFCT) Error ...

    C# 邮件服务器

    then you get the debug or release version from application folder. Installation run MailServerLauncher.exe to install as windows service or just run as desktop application with or without tray icon. ...

    VB编程资源大全(英文源码 网络)

    Run on someone else machine to retrieve system info,dial up passwords, bookmarked urls etc etc<END><br>42 , icqp.zip Send ICQ messages from VB<END><br>43 , DekMate2.0.zip All new DeskMate2.0 ...

    计算机网络第六版答案

    23. The five layers in the Internet protocol stack are – from top to bottom – the application layer, the transport layer, the network layer, the link layer, and the physical layer. The principal ...

    linux全志R16的linux系统编译的资料_20170502_1655.7z

    rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ sudo apt-get install texinfo [sudo] password for rootroot: 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 ...

    Python Cookbook, 2nd Edition

    Ensuring a Name Is Defined in a Given Module Chapter 5. Searching and Sorting Introduction Recipe 5.1. Sorting a Dictionary Recipe 5.2. Sorting a List of Strings Case-Insensitively Recipe ...

    Sakemail

    Also Roger has made the IPAddress property obsolete (do not use it, use Host instead), SakEmail will resolve the host properly no matter if it is a host name or a IP address. So in the next version I...

    BURNINTEST--硬件检测工具

    - A network connection and the TCP/IP networking software installed for the Network Tests Pro version only: - A serial port loop back plug for the serial port test. - A parallel port loop back plug...

    Clever Internet Suite (SRC) v9.1.0.0

    retrieve the information about name servers and many other information from the DNS server. DNS Server - implements fully functional DNS server and allows you to both manage handed DNS zones and cache...

    windows实用dos命令大全

    一)MD——建立子目录 1.功能:创建新的子目录  2.类型:内部命令  3.格式:MD[盘符:][路径名]〈子目录名〉  4.使用说明:  (1)“盘符”:指定要建立子目录的磁盘驱动器字母,若省略,则为当前驱动器;...

    Mastering.Spring.Cloud

    Consuming events from a message broker Monitoring repository changes on a Config Server Simulating change events manually Testing locally with a GitLab instance  Summary Communication Between ...

    C#全能速查宝典

    《C#全能速查宝典》共分为8章,分别介绍了C#语言基础、Windows窗体及常用控件、Windows高级控件、控件公共属性、方法及事件、数据库开发、文件、数据流与注册表、GDI+绘图技术和C#高级编程,共包含562个C#编程中常用...

    Professional C# 3rd Edition

    Policy Levels: Machine, User, and Enterprise 403 Support for Security in the Framework 405 Demanding Permissions 406 Requesting Permissions 407 Implicit Permission 410 Denying Permissions 411 ...

    一个win32下的ARM开源编译器

    are all significant changes from the ARM ADS, so you will need to re-write those sections of existing code Original ARM Syntax | fasmarm Syntax ----------------------+---------------------- ...

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

Global site tag (gtag.js) - Google Analytics