简体   繁体   中英

iis 8 not accepting ip address as hostname

We are trying to specify IP address instead of hostname(eg: www.abc.com) for WCF service hosted in IIS v8.0 on windows server 2012

在此处输入图片说明

This gives error saying special characters not allowed. Is this not allowed? But it works fine when we specify IP address as host name in our local systems which runs IIS v7.5.

在此处输入图片说明

A hostname is not an IP address, therefore you can't specify it in the site bindings as a host name.

If you are trying to access a service on your local IIS machine, simply having the site binding present is enough, but you may want to bind it to a specific IP address (the IP address dropdown), or if you leave it as "All Unassigned" then the application will be available on all IPs registered with the server, on your chosen port.

If you are trying to access an app on another machine from yours, you can either get a DNS value added by your network admin, or change your HOSTS file (C:\\windows\\system32\\drivers\\etc\\HOSTS) and add in your own alias:

54.XXX.XXX.XXX myalias

Which means you should then be able to access http://myalias:8092/ from your browser.

Update The validation message is apparently by design:

http://blogs.msdn.com/b/dasane/archive/2013/10/16/adding-ip-address-like-host-head-in-iis-8-shows-ui-validation-error-this-worked-fine-in-iis-7-5-and-earlier.aspx

Reading that article, I can now understand why you may want to use an IP address as a host-header, as it effectively allows you to route external IP address calls to your local machine without requirement of DNS changes. For what you need though, if the IP address is bound to an NIC on your local machine, just leave it blank as it will resolve locally anyway.

Check what you provided in Hosts file (C:\\Windows\\system32\\drivers\\etc folder) in your local machine

For the above case you need to provide the hostname not ip address

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM