Querying DNS Records

93 views
Skip to first unread message

Aaron wilson

unread,
Jan 14, 2016, 9:19:59 AM1/14/16
to Native-Client-Discuss
Hey guys. I am trying to connect to a local DNS server to query its TXT records which might contain custom user data relevant to my Chrome Extension. I have been unable to find anything relevant in the Pepper C / C++ APIs or in the Chrome Extension Javascript API. There is some mention of a DNS API on this page (https://developer.chrome.com/extensions/declare_permissions) however the link seems to be broken so I am unsure how to proceed.

Does anyone have any information or advice that might be useful to me?

Kind regards, Aaron.

Ben Smith

unread,
Jan 14, 2016, 3:00:13 PM1/14/16
to Native-Client-Discuss
Unfortunately, it doesn't look like it is possible. You can always request TCP permission and query the DNS server directly yourself, but that would require writing a Chrome App, as Chrome extensions aren't allowed TCP permissions.

As to the chrome.dns API, it is strange that it goes to a dead link. You may want to ask on a Chrome extensions group about that.

Aaron wilson

unread,
Jan 18, 2016, 4:46:27 AM1/18/16
to Native-Client-Discuss
Hi. Thanks for the reply. I'm already working towards a direct TCP query as it seems this is the only option! I did post a message in the Chrome extensions and it seems the Chrome.dns was removed but the documentation was not updated so mystery solved heh.

Thanks again.

Aaron.

Joe Kirwin

unread,
Sep 1, 2016, 11:59:21 PM9/1/16
to Native-Client-Discuss
I assume you've already moved past this by now, but for anyone else looking for answers to this. The dns API is still available, just not documented. You can try it out in the debugger.

example code:
chrome.dns.resolve("groups.google.com", function(res){ console.log(res)});
//  returns object ->  {address: "173.194.202.113", resultCode: 0}

also you'll need the "dns" permission in your manifest.

Cheers,
Joe
Reply all
Reply to author
Forward
0 new messages