admin管理员组文章数量:1198775
Detecting visitor IP is easy. But how about detecting DNS server ips of a visitor ?
I found this PHP function, however it finds only domain names' DNS.
dns_get_record("website", DNS_ANY);
Is it possible to detect visitor DNS server ?
Detecting visitor IP is easy. But how about detecting DNS server ips of a visitor ?
I found this PHP function, however it finds only domain names' DNS.
dns_get_record("website.com", DNS_ANY);
Is it possible to detect visitor DNS server ?
Share Improve this question edited Nov 24, 2013 at 12:56 BenMorel 36.5k51 gold badges203 silver badges335 bronze badges asked May 23, 2012 at 14:10 user198989user198989 4,66520 gold badges68 silver badges95 bronze badges 4- 6 In short: no. Longer: no, it's impossible. – Wrikken Commented May 23, 2012 at 14:11
- there is no way my dear friend... – jugnu Commented May 23, 2012 at 14:13
- Impossible ? So how can they detect > whoer.net – user198989 Commented May 23, 2012 at 14:18
- @user198989 — That is the DNS server responsible for holding the name associated with the user's ip address, not the DNS server the user uses to loop up other ip addresses. – Quentin Commented May 23, 2012 at 14:26
5 Answers
Reset to default 11It's not easy, but it can be done. There's a demonstration of the approach suggested in a separate answer by Adam Dobrawy at http://ipleak.net/
To add a bit of detail, the way you can implement something like this is:
Part 1 - Set up your own DNS server on myspecialdomain.com
This DNS server needs to be custom written to log and store the incoming request and the source IP address. This storage only needs to be for a short period of time, so something like memcache might work nicely. The DNS response should be an NXDOMAIN.
Part 2 - Your client-side code
In your Javscript make and store a large random number. Make the browser lookup .myspecialdomain.com. Load this via a JS img tag with an error handler. In that error handler, now make a query to your server side code passing the random number.
Part 3 - Your web application (server side)
You need to implement some server side logic that takes the random string, looks it up in the datastore, and retrieves the IP address of the DNS server. Note the IP address here will be the IP Unicast address of the particular server, it won't be an IP Anycast address like 8.8.8.8. Here you can use GeoIP or Whois databases to determine the owner of that IP address (OpenDNS, Google etc). You can then generate a response to send to the client logic.
Yes, you can, like detecting page resolution of visitors.
You need own DNS server and force user to resolve unique dns name. If user tried to resolve it then they will leaks to your DNS server own DNS server address. Next to DNS server have to share information who asked about the unique dns name to your web apps.
DNS resolution is not part of the request itself which means there is no way for the receiver of the request to know which DNS was used by the client (browser).
The DNS request happens first, as it is required to resolve the hostname to an IP address. Once this is complete, then a separate request is performed to the address in question.
The answer is NO. All the server got is a TCP connection to the visitor, that is, an [IP, Port] pair. DNS resolution depends on visitor's local configuration and can be done by a proxy.
本文标签: javaIs it possible to detect visitor DNS serverStack Overflow
版权声明:本文标题:java - Is it possible to detect visitor DNS server? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738502636a2090354.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论