# Node Red MQTT Nodes Not Resolving DNS CNAME Records?

**URL:** <https://discourse.nodered.org/t/node-red-mqtt-nodes-not-resolving-dns-cname-records/76947>\
**Category:** General\
**Created:** [26 March 2023 03:17 UTC](https://discourse.nodered.org/t/node-red-mqtt-nodes-not-resolving-dns-cname-records/76947 "2023-03-26T03:17:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [26 March 2023 03:17 UTC](https://discourse.nodered.org/t/node-red-mqtt-nodes-not-resolving-dns-cname-records/76947/1 "2023-03-26T03:17:25Z")

</div>

I have a DNS CNAME record set to [broker.dd.org](http://broker.dd.org), the actual DNS name is [infrastructure.dd.org](http://infrastructure.dd.org). When I try to use the CNAME record the Node Red MQTT nodes fail to connect.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d6ef252578b8d2a46da83bcda9ec1b82a0b39e25.png)

Use of IP address works  
Use of actual DNS name (FQDN) or short name works  
Use of CNAME record fails, node on the left is using IP or DNS name (as the case may be) the node on the right is using CNAME record, i.e. DNS alias (using the term loosely).

Any one else see this behavior.

Oh, and use pinging of the CNAME works, resolving the CNAME works, I have absolutely no reason to believe DNS is not working correctly in this case.

# nslookup [broker.dd.org](http://broker.dd.org)  
Server: 192.168.1.137  
Address: 192.168.1.137#53

[broker.dd.org](http://broker.dd.org) canonical name = [infrastructure-ethernet.dd.org](http://infrastructure-ethernet.dd.org).  
Name: [infrastructure-ethernet.dd.org](http://infrastructure-ethernet.dd.org)

# nslookup 192.168.1.3  
3.1.168.192.in-addr.arpa name = [infrastructure-ethernet.dd.org](http://infrastructure-ethernet.dd.org).

Reverse lookup should resolve to the actual device name record, not the CNAME record by the way.

I don't recall this being an issue in the past, but I have been away from NR for a while, could something in 3.0.x have changed to impact this? I know this did not happen in 1.x or 2.x. Might be a JavaScript thing?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 March 2023 06:54 UTC](https://discourse.nodered.org/t/node-red-mqtt-nodes-not-resolving-dns-cname-records/76947/2 "2023-03-26T06:54:55Z")

</div>

Is node red running in Docker, or is it a native install? Are your test commands being run on the node red server machine?  
Try the ping node and see if that sees it.

---

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [27 March 2023 13:38 UTC](https://discourse.nodered.org/t/node-red-mqtt-nodes-not-resolving-dns-cname-records/76947/3 "2023-03-27T13:38:54Z")

</div>

Not in docker. Ping node works against CNAME record. That would be expected behavior of course. I imported an older flow, and it is working, with the CNAME record. But the current newer flow still fails to connect. I am going to recreate the MQTT node and/or the flow see what happens. Feels like just have a bad node?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 March 2023 14:17 UTC](https://discourse.nodered.org/t/node-red-mqtt-nodes-not-resolving-dns-cname-records/76947/4 "2023-03-27T14:17:33Z")

</div>

Try restarting node-red and see if then works.

---

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [27 March 2023 16:17 UTC](https://discourse.nodered.org/t/node-red-mqtt-nodes-not-resolving-dns-cname-records/76947/5 "2023-03-27T16:17:10Z")

</div>

Will do, after to it later today.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 May 2023 16:18 UTC](https://discourse.nodered.org/t/node-red-mqtt-nodes-not-resolving-dns-cname-records/76947/6 "2023-05-26T16:18:07Z")

</div>

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