How can I determine the DNS server(s) that are being used?

digitalbeat

Member
Licensed User
Longtime User
There are any number of utilities (ping, ipconfig) that tell you your DNS server names how do I get this in a program? I dont even know if resolv.conf exists and/or is used in Android andI'm hoping there is a socket parameter or call that will provide the information although I'm not finding it thru Google.
 

digitalbeat

Member
Licensed User
Longtime User
Not sure how that link helps. I want to get the current namserver information in a Basic4android program. The dnsjava zip file contains over 300 files in it so I'm not going to try reading thru them without some indication that it would work. I think that using the resolver libraries in SOME unix implementations res.init followed by res.query may result in res.query filling in the nameserver name in the returned structure. I have no idea if this would work in android or windows. So is there a Basic4Android means of getting the nameserver (DNS server) name?
Thanks
 
Last edited:
Upvote 0
Top