1

When I do ipconfig /all I see DNS Suffix Search List. I need to retrieve that value from java. Does anyone knows how to get it or where does it come from?

Daniel Fischer
  • 181,706
  • 17
  • 308
  • 431
hgonzalez
  • 81
  • 1
  • 3

2 Answers2

0

The DNS suffix list is read from

HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\SearchList
Piyush Mattoo
  • 15,454
  • 6
  • 47
  • 56
  • For that to be useful, you'll also need to combine that with an answer from here - http://stackoverflow.com/questions/62289/read-write-to-windows-registry-using-java – Nate Sep 23 '11 at 17:28
  • In my computer the DNS list is in this location: HKLM\Software\Policies\Microsoft\Windows NT\DNSClient\SearchList It seems that this path may change a little bit depending on the windows version. Is there a way to read the values from java network configuration, so that I don't depend on the Windows version? I am using dnsjava library, maybe there is a way to do it with this library. Anyone knows? – hgonzalez Sep 26 '11 at 09:15
0

You could use the Runtime class to execute Windows commands (e.g. ipconfig /all) and parse the standard input.

Michael-O
  • 18,123
  • 6
  • 55
  • 121
mrkhrts
  • 829
  • 7
  • 17