# Changing the hostname

**URL:** <https://meta.discourse.org/t/changing-the-hostname/23920>\
**Category:** Product Support\
**Tags:** docker\
**Created:** [12 Gennaio 2015, 6:51pm UTC](https://meta.discourse.org/t/changing-the-hostname/23920 "2015-01-12T18:51:00Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jarrett](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@jarrett](https://meta.discourse.org/u/jarrett)\
**Post date:** [12 Gennaio 2015, 6:51pm UTC](https://meta.discourse.org/t/changing-the-hostname/23920/1 "2015-01-12T18:51:00Z")

</div>

I installed Discourse with Docker per the official instructions.

At the time of installation, I didn’t have a domain name ready, so I just used an IP address as the hostname. Later, I got the domain name working, and Discourse is accessible via that hostname.

However, the IP address–which is no longer the correct hostname for this installation–still shows up in various places. One such place is outgoing emails. When a user receives a notification of a new post, the link back to the topic has the IP address as the hostname.

I’ve replaced the IP address where I could find it:

- In the host OS at `/var/discourse/containers/app.yml`, the `DISCOURSE_HOSTNAME` key.
- Inside the Docker container at `/var/www/discourse/config/discourse.conf`, the `hostname` key.

I tried `SiteSetting.refresh!` from the Rails console. I also tried restarting the Docker container with `./launcher restart app`.

I see that in `app/views/email/_post.html.erb`, the links go to `Discourse.base_url`. From the Rails console, I see that `Discourse.base_url` is correct:

```
root@discourse:/var/www/discourse# rails console production
irb(main):001:0> Discourse.base_url
=> "http://myhost.example.com"

```

Yet the outgoing emails still have the IP address instead of the correct hostname. Any idea why that would happen, and how it might be fixed?

---

_[View the full topic](https://meta.discourse.org/t/changing-the-hostname/23920)._
