中易网

已知IP,Linux怎么获取windows主机名

答案:2  悬赏:10  
解决时间 2021-01-17 23:39
  • 提问者网友:呐年旧曙光
  • 2021-01-17 13:51
已知IP,Linux怎么获取windows主机名
最佳答案
  • 二级知识专家网友:等灯
  • 2021-01-17 14:23
#nmblookup -A IP
ip改成实际IP地址即可。
TEST那行,那就是主机名
下面那行,是组或者域名。测试过,没问题。

追问[root@~]# nmblookup aaa
querying aaa on 192.168.1.255
querying aaa on 10.99.73.255

name_query failed to find name aaa

不行,windows服务器是在域里面的,这个有影响吗?windows下是可以ping -a获取的追答我测试的那个Windows也在域里面啊。直接用nmblookup -A IP就可以看到主机名了啊
全部回答
  • 1楼网友:轻熟杀无赦
  • 2021-01-17 15:20
nmblookup - 基于TCP/IPNetBIOS客户用于查询NetBIOS名字程序
总览 SYNOPSIS
nmblookup [-M] [-R] [-S] [-r] [-A] [-h] [-B ] [-U ] [-d ] [-s ] [-i ][-T] [-f] {name}
描述 DESCRIPTION
nmblookup Samba(7)套件部
nmblookup 用于网络查询NetBIOS名字并映射应IP址使用特殊IP广播区域或者机器直接查询名字所查询操作都UDP实现
选项 OPTIONS
-M
通查找类型0x1dNetBIOS名字 name搜索主浏览器 name "-"搜索特殊名字 __MSBROWSE__ Please note that in order to use the name "-", you need to make sure "-" isn't parsed as an argument, e.g. use : nmblookup -M -- -
-R
用选项包指定希望二进制位进行递归查找 向WINS服务器发送名字查询及用户希望WINS服务器进行名字查询用种设定二进制递归位则主机普通NetBIOS处理代码(广播式)替代详细资料请参见rfc1001rfc1002
-S
通选项使名字查询操作返IP址再跟着作节点状态查询操作节点状态查询返主机注册NetBIOS名字
-r
用选项试图并绑定UDP端口137用于发送接收UDP数据包使用选项理由Windows 95面错误:忽略请求数据包原始端口复UDP端口137(系统发送接收包能并用137端口)幸情况UNIX系统绑定端口需要root权限另外运行nmbd守护程序应该绑定端口
-A
用选项name参数解释IP址并使用址作节点状态查询
-n
This option allows you to override the NetBIOS name that Samba uses for itself. This is identical to setting the netbios name parameter in the smb.conf file. However, a command line setting will take precedence over settings in smb.conf.
-i
This specifies a NetBIOS scope that nmblookup will use to communicate with when generating NetBIOS names. For details on the use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes are veryrarely used, only set this parameter if you are the system administrator in charge of all the NetBIOS systems you communicate with.
-W|--workgroup=domain
Set the SMB domain of the username. This overrides the default domain which is the domain defined in smb.conf. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local SAM (as opposed to the Domain SAM).
-O socket options
TCP socket options to set on the client socket. See the socket options parameter in the smb.conf manual page for the list of valid options.
-h|--help
打印帮助(使用)信息
-B
用给广播址发送查询没使用选项nmblookup查询发送通自检测或者smb.conf (5)文件interfaces参数定义网络接口广播址
-U
用选项指定址或者unicast address主机进行单独查询查找WINS服务器需要参数(-R选项)
-V
输程序版本号
-s
指定文件包含服务器需要配置细节文件信息包括服务器特定信息比使用哪 printcap文件;包括服务器提供服务描述查看smb.conf 获更详细信息默认配置文件名编译指定
-d|--debug=debuglevel
debuglevel 010整数参数未指定默认值0
值越高记录越关于nmblookup资料调试级设0记录紧急错误严重警告级别运行合适级别 - 产量执行操作信息
1调试级产相记录数据并且研究问题才用3调试级设计让发者使用并产极数量记录数据且其部非难理解
注意使用参数越smb.conf (5)文件log level参数
-l|--logfile=logbasename
File name for log/debug files. The extension ".client" will be appended. The log file is never removed by the client.
-T
使用选项使查找ip址通DNS反向查询查所DNS名称并结输通
IP address .... NetBIOS name
应关系前面
-f
Show which flags apply to the name that has been looked up. Possible answers are zero or more of: Response, Authoritative, Truncated, Recursion_Desired, Recursion_Available, Broadcast.
name
选项用指定要查NetBIOS名字根据前面已经使用选项能现形式NetBIOS名或者IP址用NetBIOS名则名字加入'#'指定同名字类型用*代替输入项通广播区域返所已注册名字追问[root@UISBDSRV2 ~]# nmblookup aaa
querying aaa on 192.168.1.255
querying aaa on 10.99.73.255
name_query failed to find name aaa
不行,windows服务器是在域里面的,这个有影响吗?
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息!
大家都在看
推荐信息