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.

I run "nslookup www.yahoo.com" in Windows 7.

It returns several results; some of them are IP=98.138.253.109 and alias=fd-fp3.wg1.b.yahoo.com

I tried to enter 98.138.253.109 and fd-fp3.wg1.b.yahoo.com, the former returns me a failure and the latter showed me yahoo webpage correctly.

I am wondering, since the IP 98.138.253.109 seems to be a valid IP (not like 192.168.x.x), why can't I just use it as a normal URL?

Which kind of technique or say, how can they block my access?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

On a shared web server (one server with more than one site on port 80) requests are directed based on the name used in the request. This is called Name-based virtual hosting.

For example, you could have a web server hosting pages for both the www.abc.com and www.xyz.com domains on the same IP address, on the same port. When you make a request to either site, they end up at the same IP address, so the web server looks at which host name was requested (www.abc.com or www.xyz.com), and directs the traffic to the appropriate site.

If you just use an IP address it doesn't know where to direct the request, so Yahoo shows you the "page not found" error and then redirects you to the default page instead.

share|improve this answer
    
What you mentioned could be the Name-Based virtual hosting's rule. However, how can you be sure that Yahoo is using Name-based virtual hosting? –  user4478 Feb 18 '13 at 8:04

Webservers handle requests depending on the called ressource. A (numerical) IP address is just like a domain name, so if their service isn't configured to "listen" on the IP address but only certain aliases, that behaviour is perfectly normal and has nothing to do with blocking things.

share|improve this answer
    
A domain name could consist of many computers but an IP can only be one computer. I think they are not the same? Besides, webserver can be configured to listen alias (URL) and not to listen IP? Could you please give me some concrete example? –  user4478 Feb 18 '13 at 8:06
    
Look at the answer you accepted, I was referring to name-based (v)hosts too. In general, if name-based hosting is used and there is no vhost defined for the IP itself, the behaviour can be quite undefined. Now, whether yahoo is using standard name-based hosting there or not, who knows? –  Karma Fusebox Feb 18 '13 at 8:14
    
Also, it's not true that there can only be one host behind an IP address. It might the address of a load balancer or generally a front-end that talks to an arbitrary large back-end behind the address you see. –  Karma Fusebox Feb 18 '13 at 8:17

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.