Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am having an issue that I hope you guys can help me with.

I currently am running IIS on a Windows 2008 server and it is working properly and displaying the webpage I need it to.

We have a few bad apples here that need a few webpages blocked (one of them being youtube). As of right now, since it is only 3 people, I am editing the host file and have configured the hose file as such:

127.0.0.1 www.youtube.com

This works perfectly, they are not able to access youtube.com.

I have created a webpage on IIS that has a warning. When I type in 192.168.1.188 into a web browser it displays the IIS webpage I created. So I edited the host files again and now it looks as such:

192.168.1.188 www.youtube.com

It still blocks the webpage but does not display the IIS page I created.

So my question here is, how do I get it to view the IIS webpage?

Thanks!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Flush the DNS cache on the client. Entries from the hosts file are loaded and remain in the DNS cache when the OS boots or when the DNS cache is flushed. The DNS cache still has 127.0.0.1 in it for www.youtube.com.

share|improve this answer
    
Tried that, im still getting "Server Error 404 - File or Directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable." –  Mike K Jan 8 '13 at 17:51
1  
That's a server error not a client error. You need to add a host header for www.youtube.com to the web site on the server. The clients are going to www.youtube.com, but the server says "that's not me". The host header allows the server to say "oh yes, that's me". –  joeqwerty Jan 8 '13 at 17:55
    
Ok, let me try this and see what happens. It appears I can set more than one hostname for it. Reason I ask is because I need to block 5 more sites. –  Mike K Jan 8 '13 at 17:59
2  
I don't have an IIS server here to look at but check the basics: host headers and default document and web site bindings. An HTTP 404 is technically a client error but in your case it's because the server can't find the resource the client is looking for... because the server isn't configured correctly. –  joeqwerty Jan 8 '13 at 18:05
1  
Also, run nslookup on the client for www.youtube.com and see what ip address it resolves to in order to make sure it's resolving to the correct server ip address. –  joeqwerty Jan 8 '13 at 18:07

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.