IIS 7 and Above
Dynamic ip change
Last post Jul 17, 2019 06:12 AM by Chris Becke
Jul 11, 2019 07:13 PM|vk1097|LINK
Jul 12, 2019 05:48 AM|Jalpa Panchal|LINK
For dynamic IP you could use * or "all unassigned" in iis binding.
or you can write a powershell script to get ip and add binding with site when it's changed.
Jul 12, 2019 06:42 PM|vk1097|LINK
Jul 15, 2019 05:29 AM|Jalpa Panchal|LINK
You can use below PowerShell command to set the binding in iis:
New-WebBinding -Name "site1" -IPAddress "*" -Port 80
For more information you can refer below link:
Jul 16, 2019 07:05 PM|vk1097|LINK
Jul 17, 2019 01:38 AM|Jalpa Panchal|LINK
You need to write a PowerShell script by your self to collect ip and bind it with the iis site and host file.
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.