How HostNameComparisonMode Works


How do I configure my service to listen on all of the host names for my machine?


How do I configure my service to only listen on one particular host name?


I sometimes see these funny + and * characters in URLs when using WCF. What do these characters mean?


All three of these questions are related to the feature we refer to as HostNameComparisonMode. WCF matches addresses to listening services by comparing the address you specified to several tables of address prefix paths. A prefix path claims a particular address and can also optionally claim the entire namespace of addresses that start with that prefix. Of course, someone could then claim a longer (and therefore more specific) address inside of the namespace to provide a more suitable match. The + and * characters are wildcard symbols that match against any host name for the machine. There’s no special symbol for exactly matching the name, that’s just done by writing out the name itself.


I was going to follow that by explaining how HostNameComparisonMode and prefix matching work in detail, but I found out that Kenny Wolf has already explained comparison and matching.


Next time: Keeping Connections Open in IIS

Comments (5)

  1. I have two web services and I’m seeing a deadlock when making calls between them. The operation calls

  2. IIS uses some inscrutable strings to configure the activatable bindings of a web site. Here’s the minimum

  3. I have a machine with multiple network cards. How do I control which networks my service listens on?

  4. Yesterday I got the opportunity to start playing with Windows Communication Foundation net.tcp services

  5. Yesterday I got the opportunity to start playing with Windows Communication Foundation net.tcp services