Bagaimana Apakah Web Servers Tahu jika Anda Menggunakan Akses Alamat IP Langsung atau Tidak?

Daftar Isi:

Bagaimana Apakah Web Servers Tahu jika Anda Menggunakan Akses Alamat IP Langsung atau Tidak?
Bagaimana Apakah Web Servers Tahu jika Anda Menggunakan Akses Alamat IP Langsung atau Tidak?

Video: Bagaimana Apakah Web Servers Tahu jika Anda Menggunakan Akses Alamat IP Langsung atau Tidak?

Video: Bagaimana Apakah Web Servers Tahu jika Anda Menggunakan Akses Alamat IP Langsung atau Tidak?
Video: Cara Posting Artikel Wordpress di Gutenberg Editor Mudah dan Detil! - YouTube 2024, November
Anonim
Biasanya, kami cukup mengetik alamat situs web yang ingin kami tampilkan, tetapi apakah server web benar-benar "tahu" jika kami menggunakan alamat IP langsung? Posting SuperUser Q & A saat ini memiliki jawaban untuk pertanyaan pembaca yang bingung.
Biasanya, kami cukup mengetik alamat situs web yang ingin kami tampilkan, tetapi apakah server web benar-benar "tahu" jika kami menggunakan alamat IP langsung? Posting SuperUser Q & A saat ini memiliki jawaban untuk pertanyaan pembaca yang bingung.

Sesi Tanya & Jawab Hari ini hadir untuk memberi kami SuperUser - subdivisi Stack Exchange, pengelompokan situs web Q & A berbasis komunitas.

Foto milik Cory M. Grenier (Flickr).

Pertanyaan

Pembaca SuperUser Joseph A. ingin tahu bagaimana server web dapat mengetahui apakah Anda menggunakan akses alamat IP langsung atau tidak:

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?

Bagaimana server web tahu jika Anda menggunakan akses alamat IP langsung atau tidak?

Jawabannya

Kontributor SuperUser iAdjunct memiliki jawaban untuk kami:

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.

Memiliki sesuatu untuk ditambahkan ke penjelasan? Bicaralah di komentar. Ingin membaca lebih banyak jawaban dari pengguna Stack Exchange yang paham teknologi lainnya? Lihat diskusi lengkap di sini.

Direkomendasikan: