Сегодняшняя сессия вопросов и ответов приходит к нам благодаря SuperUser - подразделению Stack Exchange, основанной на сообществах сайтам Q & A.
Фото любезно предоставлено Кори М. Гренье (Flickr).
Вопрос
Читатель SuperUser Джозеф А. хочет знать, как веб-серверы могут определить, используете ли вы прямой доступ к IP-адресу или нет:
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?
Как известно веб-серверам, если вы используете прямой доступ к IP-адресу или нет?
Ответ
Ответчик 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:
Есть что добавить к объяснению? Отключить звук в комментариях. Хотите узнать больше ответов от других пользователей Windows? Посмотрите здесь полную дискуссионную тему.