# Rename container hostname

**URL:** <https://forums.suse.com/t/rename-container-hostname/8003>\
**Category:** General\
**Created:** [December 6, 2017, 2:16pm UTC](https://forums.suse.com/t/rename-container-hostname/8003 "2017-12-06T14:16:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![galioy](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@galioy](https://forums.suse.com/u/galioy)\
**Post date:** [December 6, 2017, 2:16pm UTC](https://forums.suse.com/t/rename-container-hostname/8003/1 "2017-12-06T14:16:20Z")

</div>

I have Dev, Stage and Prod environments with the same setup (but different hosts, obviously) and the containers of the app are launched with the same name/hostname, so when I send logs to my log service, I cannot distinguish from which environment do the logs come.

I want to name the hostnames of the containers in a custom way. Currently the container hostname is overriden through this option in the `docker-compose.yml` of my Rancher setup:

```auto
labels:
   io.rancher.container.hostname_override: container_name

```

but changing that did not help. Any ideas how to set a custom hostname for the app container?
