0

I am now just starting to understand Httpcontexts and server side logic. Total beginner.

I have understood how to read the http requests from a client and get the remote IP etc.

I came across the hostname property.

I believe hostname and domain are completely different.

My undersanding is that stackoverflow is the domain name.

Given its widespread reach, stackoverflow can have multiple servers and hence multiple ip addresses.

So is there a way to determine to which server a client is requesting to in asp.net core 2.0?

  • I think it totally depends on how the application is implemented. For example, if there is a reverse proxy in place. All your requests would go to proxy and it may redirect requests to other servers which can process results. For client, it'd not be possible to know which server instance is processing the request. – AksharRoop Nov 20 '18 at 06:33

1 Answers1

0

You are correct that stackoverflow.com is a domain name. A domain name points to an IP address. That's called DNS. stackoverflow.com points to one single IP address not multiple. There's probably a load balancer at that IP address which then points you to an available server, which is internal you can't see that, but that's another story.

If you ping stackoverflow.com you get:

enter image description here

The whole point of DNS is to not use IP address but a domain name. I'm not sure why you would want to see the IP. Maybe this stackoverflow question can help: Resolve HostName to IP

Marcel
  • 954
  • 8
  • 22