Change IIS domain url

2019-08-01 08:01发布

问题:

I have a deployed web application on my local IIS (7.0) and is working perfectly. Since it's on my local, it is accessible via http://<>/webapp/index.aspx. Now, what I am trying to achieve is to access it on a custom url i.e. http://www.someuniqueweburl.com, and will make sure that it doesn't exist on the internet and of course, can only be accessed when you are on the same network with the local IIS web server. Is this achievable?

Thanks a bunch!

回答1:

You need some kind of DNS service to achieve this.

You may :

  • register a DNS entry in your local network DNS Server, if you have one. Then all your network should be able to sample.custom.url.com to your IP address

  • or add an entry line to your %windir%\System32\drivers\etc\hosts file :

    127.0.0.1 sample.custom.url.com

    but you will be the only one able to resolve sample.custom.url.com . Other machines will need a similar entry in their hosts file (with your network ip address, instead of 127.0.0.1)



回答2:

  1. Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
  2. In the Connections pane, expand the Sites node in the tree, and then select the site for which you want to configure a host header.
  3. In the Actions pane, click Bindings.
  4. In the Site Bindings dialog box, select the binding for which you want to add a host header and then click Edit or click Add to add a new binding with a host header.
  5. In the Host name box, type a host header for the site, such as www.contoso.com. Click OK.
  6. To add an additional host header, create a new binding with the same IP address and port, and the new host header. Repeat for each host header that you want to use this IP address and port.

I got this from the Microsoft technet website: Configure a Host Header for a Web Site (IIS 7)