locked
XP Pro SP3 Edit system32\drivers\etc Hosts File RRS feed

  • Question

  • Hello all,

    I am having some trouble.  I am setting up a private website.  When I enter the exact IP address into the IE8 url, it goes to the web page.  I need to be able to use a host name, so I have gone an edited the hosts file on my XP Pro SP3 machine.  When I enter the url into the IE8 address bar, I get:  "Internet Explorer cannot display the webpage" 

    # For example:
    #
    #             102.54.94.97     rhino.acme.com
    #              38.25.63.10     x.acme.com
    
    
    127.0.0.1              localhost
    192.1.1.1:1050         mysite.com

    ... WHERE .... 192.1.1.1:1050 is my Public IP Address. I have tried adding the https:// but nothing that I have tried works. It is my understanding that Windows will check the hosts file before checking any DNS servers. If the IP Name Resolve is in the file, Windows can skip the DNS servers altogether. 

    Perhaps if someone could expand on why IE8 won't go to the web page even though I have specified the Name to IP in the hosts file, I might have a clue as to how to deal with this issue.

    I appreciate your taking the time to read my post,

    Thanks!


    Student

    Thursday, December 20, 2012 9:12 AM

Answers

  • you should remove :1050 from your host file. Then type http://mysite.com:1050 in your browser. It will work fine

    regards richard

    Friday, December 21, 2012 8:37 AM

All replies

  • you should remove :1050 from your host file. Then type http://mysite.com:1050 in your browser. It will work fine

    regards richard

    Friday, December 21, 2012 8:37 AM
  • Hello Richard,

    Thanks!  I still have to check it out, but I am sure that is the answer.  I was wondering whether or not specifying the port number would work.  It also took me a while to check in with this post.  Sorry about that, I'll check back in after I get a chance to check out the solution.  For now, I will reguard your reply as helpful.

    Thanks again,


    Student

    Tuesday, January 1, 2013 5:56 PM
  • Hello again,

    ... and Happy New Year!

    Ok, so I went and edited my hosts file.  I took the port number off the end of the ip address.  I have:  "https://SomeSiteName.com" specified in the hosts file.  When I type in the exact IP address with port number into my browser, I get to my website that has certificate errors, hence the screen that ask whether to continue to the website.  When I type in the name instead of the ip address, I get the screen that says:  "Internet Explorer cannot display the webpage".  I just can't seem to get it working. 

    I am trying to set up a development site that uses SSL.  Creating a valid self-signed certificate using selfssl.exe, has been one incredible hurdle, that I have not been able to get over!  I do NOT want to register a domain name through a registrar for a lousy "Development" website!!!  On a couple of other forums, this seems to be a difficult concept for people to understand.  I hope that is not the case, here.  I mean, tell me this:  Would you want to pay for a service that should already be "Do-able" from the Microsoft Windows Operating System?  I don't, and I won't, not for development purposes.  The IIS 6.0 resource kit even explains what selfssl.exe was created for:

    Because SelfSSL generates a self-signed certificate that does not originate from
    a commonly trusted source, the tool's usefulness is limited to two specific
    scenarios:
    • When you need to create a secure private channel between your server and a
      limited, known group of users, such as exists in a software test environment. To
      establish this channel, send a copy of your certificate to clients that will use
      the Web site, so that the clients can add your SelfSSL-generated certificate to
      the list of trusted certificates.

    I am waiting on a couple of books to arrive in the mail, before I go and setup DNS.  For now, I've re-created a development website and assigned it a HostName so that hopefully, I can get rid of the error that states:  "The security certificate presented by this website was issued for a different website's address."

    ... which has to do with the /N:CN= .... apparently, assigning the certificate name to the exact IP address does not work.  I really wish that it did.  I don't understand how I kept getting that error even thought the certificate matched the url perfectly. Maybe the ONLY way is to register through a registrar, which I think is a ridiculous thing to have to do for a person just setting up a development environment for his/herself.

    So, anyway, .... this is what led me to editing the "hosts" file in the first place. That way, instead of registering a domain name through a registrar, I'd just "register" my website with the Hosts file so that my XP laptop would know where to go when I type in the HostName instead of the IP address. ... Maybe then, when I assign the common name to the certificate, I can use the name that I assigned to the Host Header Value for the website, to the certificate, AND to the host name in the Hosts file.  That way the url, and the certificate name, and the Host Header Value would all match and I would finally have a valid certificate once I installed the certificate to the Trusted Root Store.  Also, I was hoping to install it to the "Personal" store and check the "Require client certificates" check box in the Secure Communications dialog box that comes from IIS manager and rightclicking Website, Properties, Directory Security, Secure Communications Tab, and choosing Edit in the Secure Communications area.

    Yeah, well, ... I have been stuck a while now, and have moved onto other things. However, I will really, really, really, LIKE it alot if I am able to overcome this obstacle.

    If I can't even get XP to got to the same page using the HostName instead of the IP Address, I don't think I am going to get very far! lol, no I am really laughing, ... believe me.

    Help! Help!  S.O.S. lol..... help, really is much apprecitated, thanks!


    Student


    Tuesday, January 1, 2013 7:36 PM
  • Yup!  Sorry for all the confusion.  HTTPS was disabled on my router which is why I could not view the website when typing the host name into the url

    Student

    Friday, January 4, 2013 10:49 AM