# Configuring domain name and DNS

**URL:** https://meta.discourse.org/t/configuring-domain-name-and-dns/21289
**Category:** Self-hosting
**Created:** [October 19, 2014, 4:19am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289 "2014-10-19T04:19:31Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 4:19am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/1 "2014-10-19T04:19:31Z")

</div>

Hi-  
I have Discourse set up on Docker. I can send the activation email and I receive it fine. The link takes me to my site but the site url is broken. It’s configured to be: [discourse.yciw.net](http://discourse.yciw.net)

Digital Ocean says the domain is active.

I’m able to access the site via the IP address but of course I cannot activate the initial Admin account.

IP is:  
[http://104.131.117.143](http://104.131.117.143)

Please help!  
Mat

---

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 10:32am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/2 "2014-10-19T10:32:32Z")

</div>

Actually, can you confirm if I’ve done something totally dumb?

I configured Discourse to be at [discourse.yciw.COM](http://discourse.yciw.COM). I also set up my Droplet to be [discourse.yciw.COM](http://discourse.yciw.COM).

However, I do not own the domain [yciw.COM](http://yciw.COM). I own the domain [yciw.NET](http://yciw.NET)

Should I have set both the Droplet and Discourse to be for [yciw.NET](http://yciw.NET)?

thank you  
Matt

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [October 19, 2014, 10:35am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/3 "2014-10-19T10:35:07Z")

</div>

Yes, use `.net` in both DO and Discourse. Once you do it rebuild the image.

---

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 10:37am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/4 "2014-10-19T10:37:50Z")

</div>

Thanks! Do you happen to know if there is a way to edit my Droplet URL on Digital Ocean or do I need to delete it somehow and create a new one. Which I think would give me a different IP address and I’d have to start the whole process over…  
(I’ve submitted a ticket with them but I’m waiting to hear back)

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [October 19, 2014, 11:07am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/5 "2014-10-19T11:07:44Z")

</div>

1. Click on your droplet
2. Select **Settings**
3. Click on **Rename**

---

<div class="post-metadata">

### Author: ![lake54](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lake54/32/121955_2.png) [@lake54](https://meta.discourse.org/u/lake54)
#### Post date: [October 19, 2014, 11:07am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/6 "2014-10-19T11:07:52Z")

</div>

You can rename a droplet on DO, just go to the Settings for your droplet, and then the Rename tab. This won’t affect anything on the box, but it will update the PTR record.

You’ll need to rebuild your Discourse instance after editing the configuration file too.

---

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 11:14am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/7 "2014-10-19T11:14:31Z")

</div>

Thank you. I made the name change on DO and then rebuilt the Discourse instance after editing it to reflect the correct URL.

I now get a page not found error.

As you say the name change is only for show. Do I need to change the name on a deeper level in DO somehow?

thank you!

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [October 19, 2014, 11:34am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/8 "2014-10-19T11:34:08Z")

</div>

Have you set up the CNAME/A record in your registrar?

---

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 11:37am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/9 "2014-10-19T11:37:07Z")

</div>

I’m not sure what that is so I don’t think I have…

---

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 11:47am UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/10 "2014-10-19T11:47:36Z")

</div>

Digital Ocean said:  
"To update the hostname inside the droplet run the following command via SSH or console and replace with your name:

hostname your\_name\_here "

I tried doing this but I’m not sure what effect it had or if I executed it correctly. I’m definitely a newbie.

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [October 19, 2014, 12:19pm UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/11 "2014-10-19T12:19:15Z")

</div>

You have to know who owns `yciw.net`. Where did you buy it from? Usually you are provided with a user interface where you can change these settings and add the subdomains to point to the ip of your DigitalOcean droplet, like `discourse.yciw.net`.

---

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 12:21pm UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/12 "2014-10-19T12:21:22Z")

</div>

Sorry for the confusion. I own [yciw.net](http://yciw.net) and I’ve used Digital Ocean to create a droplet to host Discourse.

I’m having trouble changing the hostname.

I run the command in ssh as follows:

hostname [discourse.yciw.net](http://discourse.yciw.net)

When I look at the /etc/hostname file it still says [discourse.yciw.com](http://discourse.yciw.com)

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [October 19, 2014, 12:27pm UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/13 "2014-10-19T12:27:22Z")

</div>

Ask or search the support where you bought the domain. They should tell you how to add an A record to your domain `yciw.net`. Something like:

Host: discourse  
IP: 104.131.117.1431  
Record Type: A

---

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 12:29pm UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/14 "2014-10-19T12:29:09Z")

</div>

Thanks. I’m still stuck on trying to fix the mistake I made when setting up the droplet with the wrong url.  
Trying to edit it reflect [discourse.yciw.net](http://discourse.yciw.net)

DO wants me to edit this file:

# vi /etc/hostname

I don’t really know how to do that.

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [October 19, 2014, 12:33pm UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/15 "2014-10-19T12:33:52Z")

</div>

Do you know how to ssh in your machine? These are basic steps. Read [Support Home | DigitalOcean Documentation](https://www.digitalocean.com/help/) and [https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2).

---

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 12:35pm UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/16 "2014-10-19T12:35:55Z")

</div>

Ok, I think I did it using nano.

I went to nano /etc/hostname and made the edit.

I saved it but I still get an error when I load [discourse.yciw.net](http://discourse.yciw.net)

---

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 12:50pm UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/17 "2014-10-19T12:50:49Z")

</div>

The edit has now been correctly configured in the droplet. ([discourse.yciw.net](http://discourse.yciw.net))

site still does not load

The Discourse set up guide does not mention anything about having to add subdomains to point to the Digital Ocean server. Is this just a common step that I should do…?

---

<div class="post-metadata">

### Author: ![matt5834](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt5834/32/115094_2.png) [@matt5834](https://meta.discourse.org/u/matt5834)
#### Post date: [October 19, 2014, 1:02pm UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/18 "2014-10-19T13:02:28Z")

</div>

Ah, I see the directions now. Sorry! I need to set up the DNS on Digital Ocean.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 19, 2014, 7:12pm UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/19 "2014-10-19T19:12:38Z")

</div>

Incorrect, you need to set up the dns with your domain name registrar, the place where you bought the domain name. Unless you bought that domain name from digital ocean…

Also @lake54 the droplet name is not just for show: it changes the reverse ptr record for the ip address. Granted since we tell people to use Mandrill for email this will not affect much but it should be correct, e.g. have the correct domain name.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [October 19, 2014, 8:26pm UTC](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289/20 "2014-10-19T20:26:21Z")

</div>

For future reference, you should have edited that file with `sudoedit`. sudoedit will save a backup copy, and only overwrite the file if the editor exits normally (I think).

```
# sudoedit /etc/hostname
("Please pick an editor")

```

[Next page](https://meta.discourse.org/t/configuring-domain-name-and-dns/21289.md?page=2)
