यदि आप डायरेक्ट आईपी एड्रेस एक्सेस का उपयोग कर रहे हैं या नहीं तो वेब सर्वर कैसे जानते हैं?

विषयसूची:

यदि आप डायरेक्ट आईपी एड्रेस एक्सेस का उपयोग कर रहे हैं या नहीं तो वेब सर्वर कैसे जानते हैं?
यदि आप डायरेक्ट आईपी एड्रेस एक्सेस का उपयोग कर रहे हैं या नहीं तो वेब सर्वर कैसे जानते हैं?
Anonim
आम तौर पर, हम केवल उस वेबसाइट के पते में टाइप करते हैं जिसे हम देखना चाहते हैं, लेकिन क्या एक वेब सर्वर वास्तव में "पता" होगा यदि हम इसके बजाय प्रत्यक्ष आईपी पता इस्तेमाल करते हैं? आज के सुपर यूज़र क्यू एंड ए पोस्ट में एक भ्रमित पाठक के सवाल का जवाब है।
आम तौर पर, हम केवल उस वेबसाइट के पते में टाइप करते हैं जिसे हम देखना चाहते हैं, लेकिन क्या एक वेब सर्वर वास्तव में "पता" होगा यदि हम इसके बजाय प्रत्यक्ष आईपी पता इस्तेमाल करते हैं? आज के सुपर यूज़र क्यू एंड ए पोस्ट में एक भ्रमित पाठक के सवाल का जवाब है।

आज का प्रश्न और उत्तर सत्र हमारे पास सुपरयूसर की सौजन्य है - स्टैक एक्सचेंज का एक उपविभाग, क्यू एंड ए वेब साइट्स का एक समुदाय संचालित समूह।

फोटो कोरी एम। ग्रेनेयर (फ़्लिकर) की सौजन्य।

प्रश्न

सुपर यूज़र रीडर जोसेफ ए जानना चाहता है कि वेब सर्वर कैसे बता सकते हैं कि आप सीधे आईपी एड्रेस एक्सेस का उपयोग कर रहे हैं या नहीं:

Some web servers, when accessed using their IP address, return an error that direct IP address access is not allowed. I have been wondering for some time how this works.

Does a browser always resolve the IP address and connect to it? Direct IP address access is just skipping DNS altogether, right? How does a remote server even know that you skipped DNS?

यदि आप सीधे आईपी पते का उपयोग कर रहे हैं या नहीं, तो वेब सर्वर कैसे जानते हैं?

उत्तर

SuperUser योगदानकर्ता iAdjunct का उत्तर हमारे लिए है:

To answer your question of how it knows, it has to do with what your browser sends the web server. You are right that the system always resolves it to an IP address, but the browser sends the URL you attempted to access in the HTTP header.

Here is a sample header that I found online, modified to look as though you used Firefox on Windows and typed apple.com into the address bar:

Here is what the header would look like if you used its IP address:
Here is what the header would look like if you used its IP address:
Both of these would be sent to the same IP address over a socket, but the browser tells the web server what it accessed. Why? Because web servers with the same IP address may host multiple websites and give different pages for each. It cannot distinguish who wants which page by IP address because they all have the same one, but it can distinguish them by the HTTP header.
Both of these would be sent to the same IP address over a socket, but the browser tells the web server what it accessed. Why? Because web servers with the same IP address may host multiple websites and give different pages for each. It cannot distinguish who wants which page by IP address because they all have the same one, but it can distinguish them by the HTTP header.

स्पष्टीकरण में जोड़ने के लिए कुछ है? टिप्पणियों में विचार व्यक्त करो। अन्य तकनीक-समझदार स्टैक एक्सचेंज उपयोगकर्ताओं से अधिक उत्तरों पढ़ना चाहते हैं? यहां पूर्ण चर्चा धागा देखें।

सिफारिश की: