Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Let's assume there is a web server, and a host name.

If someone wants to visit the web server, the browser will first send a DNS query for this host name.

If I hope all DNS query for this web server should be notified to the web server immediately(so the web server knows which IP did the query), is it possible or not?

for example, all DNS queries will be forwarded by DNS server to the web server host, and the DNS server on the host respond to the web browser directly. how about the delay?

or DNS server sends a notification packet to the web server immediately when it receives a DNS query for the web server. how about the delay?

share|improve this question
    
This would be a very brittle solution. It's possible the DNS query was resolved by another DNS zone on another server owned by another company. . . –  surfasb May 28 '13 at 0:57

2 Answers 2

If someone wants to visit the web server, the browser will first send a DNS query for this host name.

Yes. To an entirely different server. I am not sure what you are assuming as a setup here, but if I want to visit your site foo.bar, I look it up with Google's DNS at 8.8.8.8 personally, and then I get your actual IP and end up at your site. The way you present your problem, you sound very confused and I'm not sure you understand how DNS works. Can you explain what you are trying to do and why you are asking this? That might give you a better answer.

share|improve this answer
    
I know what DNS is. I just hope DNS server can inform the web server who did the query. –  misteryes May 27 '13 at 20:55
    
Of course it can, if you own it. –  bigbadonk420 May 28 '13 at 7:16

To my knowledge, No.

DNS Server acts completely separately to the web server.

But the web server WILL know the client IP when the client PC/browser actually connects to the web server as the web server need to know where to send back the data/page that you requested.

share|improve this answer
    
DNS is separate from everything else. DNS is only for human readability, computers use IP addresses. –  Keltari May 27 '13 at 20:16
    
I know what DNS is. I just hope DNS server can inform the web server who did the query. –  misteryes May 27 '13 at 20:28
    
"DNS Server acts completely separately to the web server" -- this is irrelevant. As long as the DNS server knows who is asking to resolve, of course that server can share that information with the web server in some way. You just need to be in control of both of them, which is uncommon. –  bigbadonk420 May 28 '13 at 7:17
    
for example, I don't let any DNS cache the IP of the web server. then all DNS queries have to go the the authorative DNS resolver of the web server, is it possible? –  misteryes May 28 '13 at 9:53
    
I suppose as @bigbadonk420 mentioned, if you own the DNS server, and made a custom DNS code that will trigger a notification to the web server that some IP has just done a DNS query about the webserver, I guess that is possible. But again, why would the web server care? And then, you will also need a custom built web server that somehow understood the special notification that the DNS server sends to it. So yes, all in all, I guess I better change my answer to "Yes you can, with the assumption that you own both the DNS server, and web server, and write custom code to allow the transaction" –  Darius May 28 '13 at 14:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.