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
  • 178,696
  • 16
  • 303
  • 427
hgonzalez
  • 81
  • 1
  • 2

2 Answers2

0

The DNS suffix list is read from

HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\SearchList
Piyush Mattoo
  • 15,520
  • 6
  • 52
  • 59
  • 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
  • 17,715
  • 6
  • 54
  • 115
mrkhrts
  • 829
  • 6
  • 17