# Server.Hostname

**URL:** https://www.finalbuilder.com/forums/t/server-hostname/5886
**Category:** Bugs
**Created:** [January 17, 2014, 12:17pm UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886 "2014-01-17T12:17:27Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)
#### Post date: [January 17, 2014, 12:17pm UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886/1 "2014-01-17T12:17:27Z")

</div>

We have a conditional statement for months now that was always working properly. But now we discovered that its not working anymore because the expression&nbsp;$Server.Hostname$ returns "localhost" now instead of the real hostname "nemesis" (in our case).

Did you change something here? Any ideas?

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [January 17, 2014, 2:03am UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886/2 "2014-01-17T02:03:57Z")

</div>

You can force the hostname in the Continua.Server.Service.exe.config, add a key externalurl   
  
[code] [/code]   
  
You will need to restart the service after changing it (and possibly the website too).

---

<div class="post-metadata">

### Author: ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)
#### Post date: [January 17, 2014, 4:41am UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886/3 "2014-01-17T04:41:23Z")

</div>

under which node?

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [January 17, 2014, 11:32am UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886/4 "2014-01-17T11:32:12Z")

</div>

Sorry, should have said under continua-configuration

---

<div class="post-metadata">

### Author: ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)
#### Post date: [January 20, 2014, 8:15am UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886/5 "2014-01-20T08:15:14Z")

</div>

hm, the service won’t start anymore if i use this:   
  
 [code]…\<modules\>\<module name=“Continua.Modules.Builds.BuildsModule, Continua.Modules.Builds”/\>\</modules\>\<externalurl url=“[http://nemesis](http://nemesis)”\>\</continua-configuration\>[/code]

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [January 20, 2014, 11:06am UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886/6 "2014-01-20T11:06:00Z")

</div>

Looks like I missed the closing / in my example   
  
 [code]\<externalurl url="[http://nemesis](http://nemesis)" /\> [/code]

---

<div class="post-metadata">

### Author: ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)
#### Post date: [January 20, 2014, 11:20am UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886/7 "2014-01-20T11:20:48Z")

</div>

omg … did not noticed this 😉 … shame on me

---

<div class="post-metadata">

### Author: ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)
#### Post date: [February 14, 2014, 10:12am UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886/8 "2014-02-14T10:12:04Z")

</div>

it seems the last update removed this entry from config, don’t know why. just for your information. had to readd it.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [February 14, 2014, 10:24am UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886/9 "2014-02-14T10:24:38Z")

</div>

Hmm… I suspect the installer is not aware of that setting. Will check tomorrow.

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [February 17, 2014, 1:03am UTC](https://www.finalbuilder.com/forums/t/server-hostname/5886/10 "2014-02-17T01:03:50Z")

</div>

Hi Christian,  
  
Apologies for the confusion but there are two related server variables which can be used in expressions.  
  
**$Server.Url$** gets its value from a server property named ‘server.hosturl’ which can be set under Administration &nbsp;\>&nbsp;Continua Server \> Properties. This gets set by default to the

```
url value in externalurl node app.config. If this is missing it defaults to the base url of the first browser request to the web server e.g. “[http://localhost](http://localhost)”. We will however now deprecate the externalurl node as this value is always overriden by the server property anyway. We have just noticed that the $Server.Url$ variable is not picked up by the intellisense, so you probably don’t even know this exists. We will fix this for the next build.
```
  
**$Server.Hostname$** currently gets its value either from&nbsp;serverHostName attribute of the&nbsp;configuration\continua-configuration\endpoints node in the agent config file when accessed from the agent or from Environment.MachineName&nbsp;when accessed on the server. We will add a server property for this in the next build to allow the default value to be overridden.  
  
Meanwhile please ensure that the&nbsp;serverHostName attribute&nbsp;in the agent config file has the correct hostname if you want to use $Server.Hostname$.
