IIS 7 and Above
Dynamic ip change
Re: Dynamic ip change
Jul 17, 2019 06:12 AM|Chris Becke|LINK
If you are using host files so people can visit the site by name - or even DNS, then typically what you would do is configure your IIS server with potentially multiple sites:
If you used AppCmd, because who has time to do stuff over and over again in a GUI, and powershell is the enemy of reason then you would setup the bindings for two sites like this.
%windir%\system32\inetsrv\appcmd set site /site.name:mysite1 /+bindings.[protocol='http',bindingInformation='*:80:mysite1.example.com']%windir%\system32\inetsrv\appcmd set site /site.name:mysite2 /+bindings.[protocol='http',bindingInformation='*:80:mysite2.example.com']
This would get two sites, listing on *ALL* IP addresses: instead IIS would look at the host header to determine the correct site to route requests to.