如何过滤包含主机名和域的IP列表? [英] how to filter an IP list which consist hostname and domain?

查看:109
本文介绍了如何过滤包含主机名和域的IP列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如本主题所述,
我目前正在做一个项目,
我可以列出局域网中所有活动的IP,
IP地址的范围由用户指定,
扫描完成后,
它显示带有主机名(xxx-pc)和域(xx.inu.edu.my)的结果,
是否有任何方法可以让我保留仅显示主机名(一台计算机)的结果

为了使事情更清楚,
我的意思是这里的主机名和域类似于本文中提到的答案
http://superuser.com /questions/59093/difference-between-主机名和域名 [
在我的列表框结果中,
有很多域"intimal.edu.my","newinti.edu.my"
并且其中许多占用IP地址,因此当我扫描网络时,它会出现在结果中.

我想要的是获取由机器而不是域占用的活动IP的列表.


对于您来说,我指的是本文
https://lh4.googleusercontent .com/-R-yBiHVKRF8/UCn_eeSEVCI/AAAAAAAAANo/wnevukhnpqY/s287/Fullscreen + capture + 1482012 + 33338 + PM.bmp.jpg [

as mention in the subject,
im currently doing a project,
where i can list out all the active IP in the local area network,
the range of IP address is specified by user,
When the scanning is done,
it shows the results with hostname(xxx-pc) and domain(xx.inu.edu.my),
is there any method that allow me to keep the result that only show hostname(a machine)

to make things more clear,
the hostname and domain i mean here is similar to the answer mention in this article
http://superuser.com/questions/59093/difference-between-host-name-and-domain-name[^]

"domain part would reach you to the campus network
and the hostname would let you reach the exact machine in the campus."

in my list box result,
there are many domain "intimal.edu.my", "newinti.edu.my"
and many of them occupy an IP address, thus when i scan the network, it appear in the result.

What i want is to get a list of active IP that occupied by a machine, not domain.


For you info, i''m referring the code from this article Implement a basic IP Scanner for a local LAN in C#[^]
(click below link to view the screen shot)

Screenshot reference:
https://lh4.googleusercontent.com/-R-yBiHVKRF8/UCn_eeSEVCI/AAAAAAAAANo/wnevukhnpqY/s287/Fullscreen+capture+1482012+33338+PM.bmp.jpg[^]

推荐答案

检查 [ ^ ] SO线程.我想这就是您要尝试的方法.
Check this[^] SO thread. I guess this is what you are trying to do.


我想我已经在这里给您了答案:
I suppose I already gave you an answer here: How to scan a range of IP address and list all the active PCs with IP address and MAC[^], but you have not accepted it :(.
You should use my address enumerator and the ping and dns lookup from the solution suggested by d@nish.


这篇关于如何过滤包含主机名和域的IP列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆