在Java程序中是否可以访问Windows计算机的ipconfig/all输出的“连接特定的DNS后缀”字段中包含的字符串?如何访问Java中每个NetworkInterface的连接特定DNS后缀?
如:
C:> IPCONFIG/ALL
以太网适配器本地连接:
Connection-specific DNS Suffix . : myexample.com <======== This string
Description . . . . . . . . . . . : Broadcom NetXtreme Gigabit Ethernet
Physical Address. . . . . . . . . : 00-30-1B-B2-77-FF
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.1.66
Subnet Mask . . . . . . . . . . . : 255.255.255.0
我知道getDisplayName()将获得返回描述(例如:博通NetXtreme千兆以太网),并且getInetAddresses()会给我一个绑定到这个网络接口的IP地址列表。
但也有阅读的“连接特定的DNS后缀”的方式?
这并不为我工作(Java 8中,Windows 10)。 – jumar 2016-10-17 14:12:47