# How to use External DNS

**URL:** <https://forums.suse.com/t/how-to-use-external-dns/2107>\
**Category:** Rancher 1.x\
**Created:** [March 21, 2016, 1:26am UTC](https://forums.suse.com/t/how-to-use-external-dns/2107 "2016-03-21T01:26:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nlhkh](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@nlhkh](https://forums.suse.com/u/nlhkh)\
**Post date:** [March 21, 2016, 1:26am UTC](https://forums.suse.com/t/how-to-use-external-dns/2107/1 "2016-03-21T01:26:36Z")

</div>

I am trying to use CloudFlare DNS service.

Suppose that my domain name is **[mydomainname.com](http://mydomainname.com)**, and my load balancer has name **lb**.

I setup External CloudFlare DNS with the **root domain** (need more explaination on this keyword) to “[mydomainname.com](http://mydomainname.com)”.

When I check my CloudFlare DNS manager, I see a new A record with name **lb.stack.mydomainname**. I wonder why it does not have the “.com” at the end.

Anyway, I proceed to setup my CNAME to point to “lb.stack.mydomainname”, and it cannot resolve the DNS at all.

The point is, there is no instruction on how one is suppose to use this External DNS Service. I think more doc/example with details (such as saying “suppose your domain name is [yourname.com](http://yourname.com)”) would be very valuable.

---

<div class="post-metadata">

**Author:** ![clescot](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/clescot/32/317_2.png) [@clescot](https://forums.suse.com/u/clescot)\
**Post date:** [March 21, 2016, 10:38am UTC](https://forums.suse.com/t/how-to-use-external-dns/2107/2 "2016-03-21T10:38:11Z")

</div>

Hi,  
when oyu setup a load balancer, you should have a A record on the cloudflare DNS manager which point to  
`lb.stack.environment.mydomainname.com`  
but displayed in the manager page as  
`lb.stack.environment`  
(.mydomainname.com is implicit on the cloudflare page).

you don’t have to setup manually some DNS entries, for containers/tacks/environments created by rancher.  
It seems weird that no environment appears in the A record.  
for more clarity, rename your environment as test, qa, production, or another meaningful label.

hope it helps,

Charles.

---

<div class="post-metadata">

**Author:** ![nlhkh](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@nlhkh](https://forums.suse.com/u/nlhkh)\
**Post date:** [March 21, 2016, 2:09pm UTC](https://forums.suse.com/t/how-to-use-external-dns/2107/3 "2016-03-21T14:09:04Z")

</div>

It still does not work for me.

In my case, I have a domain name “[domainname.com](http://domainname.com)”. I have my service running in a container at port 9000. I want my service to be accessible at “[www.domainname.com](http://www.domainname.com)”, and “[domainname.com](http://domainname.com)”.  
I have my load balancer “lb” listening on port 80, and forward traffic to port 9000.  
When I deploy the CloudFlare External DNS, I can see an A record with the name “lb.dev.env”. Accessing “[http://lb.dev.env.domainname.com](http://lb.dev.env.domainname.com)” will render my website correctly.

However, when I specify my request host in the target service in the load balancer, i.e. setting up [www.domainname.com](http://www.domainname.com) on port 80 to point to my service on port 9000, I cannot access my service any longer, not on “[http://www.domainname.com](http://www.domainname.com)”, not on “[http://lb.dev.env.domainname.com](http://lb.dev.env.domainname.com)”. So I try to manually setup CNAME www in CloudFlare, and that does not help.

Could you point out if I miss anything?

---

<div class="post-metadata">

**Author:** ![alena](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/alena/32/50_2.png) [@alena](https://forums.suse.com/u/alena)\
**Post date:** [March 22, 2016, 9:24pm UTC](https://forums.suse.com/t/how-to-use-external-dns/2107/4 "2016-03-22T21:24:05Z")

</div>

@nlhkh

> However, when I specify my request host in the target service in the load balancer, i.e. setting up [www.domainname.com](http://www.domainname.com) on port 80 to point to my service on port 9000. I cannot access my service any longer, not on “[http://www.domainname.com](http://www.domainname.com)”, not on “[http://lb.dev.env.domainname.com](http://lb.dev.env.domainname.com)”

to clarify - do you set up hostname routing rule so all the requests for “[www.domainname.com](http://www.domainname.com)” would go to target service listening on port 9000? If so, accessing “[http://lb.dev.env.domainname.com](http://lb.dev.env.domainname.com)” wouldn’t work as the requested host doesn’t match “[www.domainname.com](http://www.domainname.com)” defined on the rule.

> So I try to manually setup CNAME www in CloudFlare, and that does not help.

Have you set [www.domainname.com](http://www.domainname.com) to [http://lb.dev.env.domainname.com](http://lb.dev.env.domainname.com) cname, and it didn’t work? Wonder if the final request hitting the LB host/port, has “[lb.dev.env.domainname.com](http://lb.dev.env.domainname.com)” in the request. If that is true, you can try setting up host name routing rules rendering lb traffic to have “[lb.dev.env.domainname.com](http://lb.dev.env.domainname.com)” as a requested host.

---

<div class="post-metadata">

**Author:** ![nlhkh](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@nlhkh](https://forums.suse.com/u/nlhkh)\
**Post date:** [March 23, 2016, 1:05am UTC](https://forums.suse.com/t/how-to-use-external-dns/2107/5 "2016-03-23T01:05:00Z")

</div>

I figured out the problem.

Here are 2 mistakes that I made:

1. In CloudFlare, Rancher External DNS created an A record with name “container.stack.env”. I then have to create CNAME (or other types of record) to point to “[container.stack.env.domain.com](http://container.stack.env.domain.com)”, but instead I thought I only need the A record name part, i.e. pointing to “container.stack.env”, which cannot resolve to an ip address.

2. I also configure SSL, but I forgot that I have to configure the port to be 443 instead of 80. Putting SSL on port 80 blocks everything!

Thank you for your help! 🙂

---

<div class="post-metadata">

**Author:** ![alena](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/alena/32/50_2.png) [@alena](https://forums.suse.com/u/alena)\
**Post date:** [March 23, 2016, 4:26pm UTC](https://forums.suse.com/t/how-to-use-external-dns/2107/6 "2016-03-23T16:26:02Z")

</div>

@nlhkh 🙂 glad everything got resolved

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [March 23, 2016, 4:45pm UTC](https://forums.suse.com/t/how-to-use-external-dns/2107/7 "2016-03-23T16:45:24Z")

</div>


