LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 743|回复: 3

如何返回主机名

[复制链接]
发表于 2003-4-28 19:45:01 | 显示全部楼层 |阅读模式
对于 未装防火墙的电脑使用ping 命令不像Win ping ip -a 那样能返回主机名
请问ping有无办法得到主机名
nmap 似乎只是端口也不能得到主机名
 楼主| 发表于 2003-4-29 00:13:37 | 显示全部楼层
没人知?
发表于 2003-4-30 21:31:59 | 显示全部楼层
用host来试一下。

host IP地址 这样能得到主机名
host 域名  这样就能得到IP

但据我发现,host IP不能推断出主机名,但host的确是这样的一样测试主机名的命令

host
Usage: host [-aCdlrTwv] [-c class] [-n] [-N ndots] [-t type] [-W time]
            [-R number] hostname [server]
       -a is equivalent to -v -t *
       -c specifies query class for non-IN data
       -C compares SOA records on authoritative nameservers
       -d is equivalent to -v
       -l lists all hosts in a domain, using AXFR
       -n Use the nibble form of IPv6 reverse lookup
       -N changes the number of dots allowed before root lookup is done
       -r disables recursive processing
       -R specifies number of retries for UDP packets
       -t specifies the query type
       -T enables TCP/IP mode
       -v enables verbose output
       -w specifies to wait forever for a reply
       -W specifies how long to wait for a reply
 楼主| 发表于 2003-5-1 01:59:14 | 显示全部楼层
谢谢 host命令的功能和nslookup是一样的。都是域名查询
用来返回主机名是不行 难到要借助其它软件了

另外 请问下查询其它电脑的MAC地址 是什么命令 windows下是arp -s IP
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表