locked
how to set host name for my website on local intranet? IIS 7.5 RRS feed

  • Question

  • User-677104951 posted

    I added a website on my windows 10 workstation using IIS 7.5   

    From this site I have a basic .htm page.  I can browse my site/page if I don't use a host name  but use my local workstation IP address (and other users can also access my site/page on the local intranet).  I can browse it using port 80 or port 8082, ...  But if I add a host name to the binding of my site (from my windows 10 workstation) and try to browse the site/page  I get this error message

    <big>Network Error (dns_unresolved_hostname)</big> 

    I then went to C:\Windows\System32\drivers\etc\hosts  on my workstation and edited the hosts file and added my local IP address and the desired hostname

    123.45.67.8          mytestsite.com

    and saved the file.  Still when I try browsing my site I receive the same -- Network Error (dns_unresolved_hostname)   error message.  

    Is there anything else I need to do?  Anything else I can do to use a host name for my site to use on my local intranet?

    Wednesday, October 11, 2017 6:11 PM

All replies

  • User-2064283741 posted

    Is your servers IP the one in the local client hosts file?

    Are you going through a proxy that will override teh host fiel entries?

    Wednesday, October 11, 2017 6:17 PM
  • User-677104951 posted

    I don't know.  How can I check?   The DNS, etc is all set to automatic on my network.  In this case is there still a way to use a host name or does something need to be static?

    Wednesday, October 11, 2017 6:24 PM
  • User-677104951 posted

    I went and checked on Internet Options/Connection/Lan settings  and  the use automatic configuration Script is checked and this is in that box

    http://proxy.......com:8083/

     Nothing is checked on the Proxy server area.  So, ...  is there something I can do/need to do there? 

    I tried checking Bypass proxy server for local addresses, but that did not do anything.

    Wednesday, October 11, 2017 6:53 PM
  • User-2064283741 posted
    Run nslookup from a command prompt compare it to a tracert

    I can't offer solutions if your Corp proxy re-looked up the hosts DNS

    Wednesday, October 11, 2017 7:38 PM
  • User-677104951 posted
    C:\Users\joe>nslookup
    Default Server:  uspmscdc019.na.blkint.com
    Address:  69.52.29.138
    
    > server 69.52.29.138
    Default Server:  uspmscdc019.na.blkint.com
    Address:  69.52.29.138
    
    > set q=mx
    > mytest.com
    Server:  uspmscdc019.na.blkint.com
    Address:  69.52.29.138
    
    *** uspmscdc019.na.blkint.com can't find myjsontest.com: Non-existent domain
    >

    Am I stuck just using my workstation IP address (Ethernet card IP ) ?

    Wednesday, October 11, 2017 7:52 PM
  • User-460007017 posted

    Hi Rich P123,

    I think you'd better use ping  xxx.xxx.xxx.xxx command to check the IP address. The nslookup will return the dns record while you were using using hosts file indeed.

    Just use ipconfig to check what the ip address you are using. for example, on my side it will return the ipv4 address 192.168.2.1.Then add the  record below to hosts file:

     192.168.2.1    www.hahaha.com

    and set add the following binding for your site.

    <bindings>
                        <binding protocol="http" bindingInformation="192.168.2.1:80:www.hahaha.com" />
                    </bindings>

    Of course, you could post the ping record

    Best Regards,

    Yuk Ding

    Thursday, October 12, 2017 7:37 AM
  • User-677104951 posted

    Hello Yuk, thank you for your reply.  I performed all of the recommended actions -- snapshots below -  but one problem I am having is that in IIS in my website Site Bindings window -- the Binding Information does not contain any information and is  not editable.  What should I do now?

    Here is my IPconfig

    and here is my hosts file

    Thursday, October 12, 2017 4:11 PM
  • User-460007017 posted

    Hi Rich,

    You only need to leave the binding information blank while it is blank on my side as well. So what's the ping result now? I think you'd better edit your post and hide your public IP while it seems doesn't safe.

    Best Regards,

    Yuk Ding

    Tuesday, October 17, 2017 9:07 AM
  • User-677104951 posted

    Hello Yuk,

    Thank you for your advisement (on my prior post).  When I ping my site on my local win10 workstation using my local IIS server I get the following result

    C:\Users\prichard>ping http://myjsontest.com
    Ping request could not find host http://myjsontest.com. Please check the name and try again.

    And I receive the same result if I ping http://12.34.5.67s:8082   (the port I am using)

    which is the one used in the edit bindings.  However, I can browse my site if remove the hostname from the edit binding window.  I can browse my site throughout my entire intranet.

    Tuesday, October 17, 2017 6:32 PM
  • User-460007017 posted

    Hi  Rich P123,

    I think you'd better ping www.myjsontest.com instead of myjsontest.com. The hosts record should be the same as IIS binding. In addition, when you were trying ping, the port number should be ignored like ping 12.34.5.67.

    Best Regards,

    Yuk Ding

    Wednesday, October 18, 2017 7:56 AM
  • User-677104951 posted

    Hello Yuk,

    I was able to ping www.myjsontest.com successfully by setting it to my local default IP address -- BUT when I try

    http://www.mysontest.com   in the browser

    I receive this message in the browser

    Error (dns_unresolved_hostname) 
     Your requested host "www.myjsontest.com" could not be resolved by DNS 
    

    Note:  this site is a basic .htm site

    I also need to add an asp.net mvc web application to this IIS for testing deployment.  I already have one sample mvc app located under default website -- but that one is the actual source application.  I want to create a separate site on the same IIS box (my win10 workstation) with a separate directory which I can deploy my sample web app to.  Right now I can access the web app in the default website like this:

    http://localhost/mychartsample1/

    If I place this web app in a separate site on my IIS -- how will it be distinguished from the www.myjsontest.com site?  (I would be using  the same IP address)  Or can I only do one site at a time? on this workstation IIS?

    Wednesday, October 18, 2017 3:38 PM
  • User-677104951 posted

    Well, I made one interesting discovery -- on my win10 workstation IIS I can do this in the browser to see my individual site(s):

    http://localhost/myjsontest

    http://localhost/mycharttest2

    ....

    Wednesday, October 18, 2017 4:40 PM
  • User-460007017 posted

    Hi Rich P123,

    Have you set the binding for your IIS?

    Here is how I set the IP and host name, and it also display the content fine.

    Just try to clean the browser cache.

    Best Regards,

    Yuk Ding

    Thursday, October 19, 2017 6:08 AM
  • User-677104951 posted

    Hello Yuk,

    FYI, the image you linked to your post is not displaying on my browser.   That probably contains the information I need I'm sure ;)  .

    I think the place where I am at has a restriction on what sites I can access.  Your image probably on a site that is not authorized at my place.

    Thursday, October 19, 2017 3:10 PM
  • User-2064283741 posted

    FYI the image displays fine.

    Friday, October 20, 2017 12:31 AM
  • User-677104951 posted

    Hello Yuk,

    I just looked at this post from my personal computer and was able to see the image.  Question:  what command gives the Ethernet card information -- IPV4 ..... ?

    Nevermind -- ipconfig.

    My workstation has massive security -- I already tried the IPv4 address of my workstation.  That could not be resolved.

    Tuesday, October 24, 2017 3:30 AM
  • User-460007017 posted

    Hi Rich P123,

    Have you tried to add the ipaddress to IP listen list?

    https://msdn.microsoft.com/en-us/library/windows/desktop/cc307219(v=vs.85).aspx

    If the IP and binding just be configured correctly. You may need to check the server side and network issue.

    Best Regards,

    Yuk Ding

    Wednesday, October 25, 2017 9:04 AM
  • User-677104951 posted

    Have you tried to add the ipaddress to IP listen list?

    I just tried this at the command prompt --- >netsh http add iplisten ipaddress=12.34.5.67

    the result message said --- IP address successfully added

    then I try >ping www.myjsontest.com

    and I get a reply.   But when I go to the browser I get various messages -- ipaddress can't be resolved, cant reach this page

    also, I can no longer do http://localhost/www.myjsontest.com -- message says cant reach this page

    I can only browse the site like this http://12.34.5.67     by inputting the IP address.   

    Hopefully, there is a way I can configure my IPv4 address/my local IIS so I can use an alias name for my site.   I will keep trying if you have more suggestions for me to try.

    Many thanks for all the help thus far.

    Wednesday, October 25, 2017 4:49 PM
  • User-460007017 posted

    Hi Rich P123,

    Now that you could access the site with http://12.34.5.67, please try again to add record to hosts file

    12.34.5.67   www.myjsontest.com and could you provide a screenshot for  binding with: 12.34.5.67 and www.myjsontest.com.  Then delete all the browser cache.

    If it is still not working, maybe you could only use this:

    127.0.0.1   www.myjsontest.com and 

    and

      <binding protocol="http" bindingInformation="*:80:www.myjsontest.com" />

    I really hope I can help you fix this issue in person on your side.

    Best Regards,

    Yuk Ding

    Thursday, October 26, 2017 8:11 AM
  • User-677104951 posted

    Hello Yuk,

    Thank you again for this suggestion.  I did as you suggested with 127.0.0.1  and I updated the hosts file and added to iplisten -- but I get this message from nslookup:

    C:\Users\prichard>nslookup www.myjsontest.com Server:  uspmabc.na.blkint.com Address:  21.34.65.789

    *** uspmabc.na.blkint.com can't find www.myjsontest.com: Non-existent domain

    I also tried with removing 127.0.0.1 from iplisten and received the same message from nslookup

    The only thing I can think of -- for now -- is to use the IPaddress of my workstation and a (virtual) folder name under Default website to distinguish my various sample applications -- without a hostname

    Thursday, October 26, 2017 7:51 PM
  • User-460007017 posted

    Hi Rich P123,

    set 127.0.0.1 in hosts file is only available for you to access the website via local. So just please try to access the website from web browser directly. The nslookup will resolve the domain name from DNS server. Add record in hosts file will not affect the DNS resolve result. However, your dns server doesn't have a CNAME of www.myjsontest.com. So unless you purchase a public domain www.myjsontest.com and the domain provider bind your ip address with domain name, your website will not available from the external network.

    Best Regards,

    YuK Ding

    Monday, October 30, 2017 2:08 AM
  • User-677104951 posted

    set 127.0.0.1 in hosts file is only available for you to access the website via local. So just please try to access the website from web browser directly. The nslookup will resolve the domain name from DNS server. Add record in hosts file will not affect the DNS resolve result. However, your dns server doesn't have a CNAME of www.myjsontest.com. So unless you purchase a public domain www.myjsontest.com and the domain provider bind your ip address with domain name, your website will not available from the external network.

    Yes, this is what I was  thinking.  Well, I think my workaround for now then would be to add my test projects under Default Web Site.  I seem to be able to use my NIC IP address and then ==>http://12.34.5.67/mySampleProject

    This will do for now.

    Monday, October 30, 2017 4:12 PM
  • User-460007017 posted

    Hi Rich P123,

    As long as the App could be accessed via IP address.  It should not that difficult to set the binding for internal IIS. Do you have something like NAT?

    Best Regards,

    Yuk Ding

    Tuesday, October 31, 2017 8:00 AM
  • User-677104951 posted

    Hello Yuk,  I was away for a short while. 

    No, don't have NAT.  I am behind a proxy though.

    Tuesday, November 7, 2017 12:05 AM
  • User-460007017 posted

    Hi Rich P123,

    Have you fixed this issue? If you still haven't fixed this issue, maybe you could post a screen shot with the ping www.myjsontest.com, the displayed result in web browser and the binding host header configuration. The host name should not be set that complicated.

    Best Regards,

    Yuk Ding

    Tuesday, December 26, 2017 7:01 AM
  • User1627102131 posted

    I also try to change IP Address on windows 10. So I follow this tutorial how to change IP address on windows 10  

    This is right for me?

    Thanks

    Tuesday, December 24, 2019 8:26 AM