# Kibana "server.host" parameter won't work with hostname

**URL:** <https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112>\
**Category:** Kibana\
**Created:** [November 9, 2018, 10:09pm UTC](https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112 "2018-11-09T22:09:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [November 9, 2018, 10:09pm UTC](https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112/1 "2018-11-09T22:09:46Z")

</div>

Hi

Elastic,kibana 6.4.3  
Centos 7.5

I am having problem with **server.host** parameter. It just won't work with hostname.

> server.host: "[someHostname.domain.com](http://someHostname.domain.com)"  
> or  
> server.host: "someHostname"

Works with IP for example.

> server.host: " **192.168.1.5**"

With hostname, I get this error when starting the service.

> kibana[26938]: **FATAL { ValidationError: child "server" fails because [child "host" fails because ["host" must be a valid hostname]]**  
> kibana[26938]: at Object.exports.process (/usr/share/kibana/node\_modules/joi/lib/errors.js:181:19)  
> kibana[26938]: at internals.Object.\_validateWithOptions (/usr/share/kibana/node\_modules/joi/lib/any.js:651:31)  
> kibana[26938]: at module.exports.internals.Any.root.validate (/usr/share/kibana/node\_modules/joi/lib/index.js:121:23)  
> kibana[26938]: at Config.\_commit (/usr/share/kibana/src/server/config/config.js:138:35)  
> kibana[26938]: at Config.set (/usr/share/kibana/src/server/config/config.js:108:10)  
> kibana[26938]: at Config.extendSchema (/usr/share/kibana/src/server/config/config.js:81:10)  
> kibana[26938]: at \_lodash2.default.each.child (/usr/share/kibana/src/server/config/config.js:70:14)  
> kibana[26938]: at arrayEach (/usr/share/kibana/node\_modules/lodash/index.js:1311:13)  
> kibana[26938]: at Function. (/usr/share/kibana/node\_modules/lodash/index.js:3389:13)  
> kibana[26938]: at Config.extendSchema (/usr/share/kibana/src/server/config/config.js:69:31)  
> kibana[26938]: at new Config (/usr/share/kibana/src/server/config/config.js:60:10)  
> kibana[26938]: at Function.withDefaultSchema (/usr/share/kibana/src/server/config/config.js:53:12)  
> kibana[26938]: at   
> kibana[26938]: at process.\_tickCallback (internal/process/next\_tick.js:188:7)  
> kibana[26938]: at Function.Module.runMain (module.js:695:11)  
> kibana[26938]: at startup (bootstrap\_node.js:191:16)  
> kibana[26938]: at bootstrap\_node.js:612:3  
> kibana[26938]: isJoi: true,  
> kibana[26938]: name: 'ValidationError',  
> kibana[26938]: details:  
> kibana[26938]: [ { message: **'"host" must be a valid hostname'** ,  
> kibana[26938]: path: 'server.host',  
> kibana[26938]: type: 'string.hostname',  
> kibana[26938]: context: [Object] } ],  
> kibana[26938]: \_object:  
> kibana[26938]: { pkg:  
> kibana[26938]: { version: '6.4.3',  
> kibana[26938]: branch: '6.4',  
> kibana[26938]: buildNum: 18044,  
> kibana[26938]: buildSha: '968768f01f873fec244749abc3c6e939d0e3eda0' },  
> kibana[26938]: dev: { basePathProxyTarget: 5603 },  
> kibana[26938]: pid: { exclusive: false },  
> kibana[26938]: cpu: undefined,  
> kibana[26938]: cpuacct: undefined,  
> kibana[26938]: server:  
> kibana[26938]: { port: 5601,  
> kibana[26938]: host: '**[someHostname.domain.com](http://someHostname.domain.com)**',  
> kibana[26938]: defaultRoute: '/app/monitoring' } },  
> kibana[26938]: annotate: [Function] }  
> systemd[1]: kibana.service: main process exited, code=exited, status=1/FAILURE  
> systemd[1]: Unit kibana.service entered failed state.  
> systemd[1]: kibana.service failed.  
> systemd[1]: kibana.service holdoff time over, scheduling restart.  
> systemd[1]: Started Kibana.  
> systemd[1]: Starting Kibana...

In linux, **/etc/hostname** has entry for full hostname (with domain), so for example:

> [someHostname.domain.com](http://someHostname.domain.com)

Regards  
Raul

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [November 16, 2018, 10:52am UTC](https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112/2 "2018-11-16T10:52:32Z")

</div>

Anynone..?

Regards  
Raul

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [November 16, 2018, 4:45pm UTC](https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112/3 "2018-11-16T16:45:05Z")

</div>

Are you able to ping machine hostname directly ? That would be my first guess . Secondly, on the Kibana host, use `netstat` (assuming linux), e.g. `netstat -an | grep 5601` , to see which host/port Kibana binds to. Check which interface Kibana is bound to on the Kibana host. If that is all interfaces, this still sounds to me like a networking/firewall issue. What about iptables on the host itself?

many things in play here...hope some of the above debugging helps...

Thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [November 16, 2018, 6:13pm UTC](https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112/4 "2018-11-16T18:13:01Z")

</div>

Yes, ping works fine.  
Hostname itself is 100% correct.

> /usr/share/kibana/bin/kibana "-c /etc/kibana/kibana.yml"
> 
> FATAL Error: [server.host]: value is [**[correctHostname.domain.com](http://correctHostname.domain.com)**] but it must be a valid hostname (see RFC 1123).

Changed to wrong hostname.

> vi /etc/kibana/kibana.yml  
> /usr/share/kibana/bin/kibana "-c /etc/kibana/kibana.yml"
> 
> FATAL Error: getaddrinfo ENOTFOUND **[wrongHostname.domain.com](http://wrongHostname.domain.com)**

So if I change to wrong hostname, the error is totally different.

KIbana at the moment is bind to linux host IP address port 5601.

I don't understand..

> Check which interface Kibana is bound to on the Kibana host.

Regards  
Raul

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [November 16, 2018, 9:12pm UTC](https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112/5 "2018-11-16T21:12:53Z")

</div>

Hi there Raul,

I dug into the validation logic we use in 6.4.3 for the hostname and found that we do 2 checks:

- The string must be \<= 255 characters
- The string must match this regex: `/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/`

Check to see if your hostname is matching these two criteria. I wasn't able to reproduce the problem with the exact examples you gave here, so I'm assuming you're actually using a different one than the ones given.

I went ahead and programmed that regex into this site here where you can try testing your hostname against it by pasting it into a new line in the "Test strings" section: [https://www.regextester.com/?fam=105996](https://www.regextester.com/?fam=105996)

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [November 16, 2018, 9:25pm UTC](https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112/6 "2018-11-16T21:25:57Z")

</div>

Hi

Thanks for the update, same applies in 6.5.0 as well.

And I found the problem, my hostname looks something like this:

> sometext\_2.domain.com

**"\_"** is something, that does not match. It was new to me that "\_" is not allowed

Regards  
Raul

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [November 19, 2018, 4:30pm UTC](https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112/7 "2018-11-19T16:30:18Z")

</div>

Yes, that underscore is probably the issue! You can use dashes instead. Glad we were able to track down the cause, though I'm sure this error could be a bit more informative.

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [November 19, 2018, 4:36pm UTC](https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112/8 "2018-11-19T16:36:55Z")

</div>

> [@joshdover](#):
>
> though I'm sure this error could be a bit more informative.

Couldn't agree you more ..🙂

But thanks a lot, problem solved.

Regards  
Raul

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 17, 2018, 4:37pm UTC](https://discuss.elastic.co/t/kibana-server-host-parameter-wont-work-with-hostname/156112/9 "2018-12-17T16:37:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
