IMD SolutionComputing LibraryShop main store

Troubleshooting

Why an MQTT app rejects a broker hostname and needs an IP address

Edge computing and IIoT Published 8 min read By IMD Solution engineering team

Short answer

The installed release of the app validates its MQTT address field as numeric only, so a broker hostname is rejected before any packet leaves the controller. Resolve the name and enter the numeric address with port 1883, SSL Protocol set to None and Certificate set to None for the plain public listener; the reported test connected exactly that way. The failed connection to the local broker is a separate listener, TLS and credential fault the public test does not touch.

On this page
  1. The address field rejects hostnames before any packet leaves
  2. Resolve the hostname with the DNS service the host uses
  3. Port, SSL Protocol and certificate must match the listener
  4. Where the connection stops
  5. Worked example: the public broker test with a numeric address
  6. The secure local broker is a separate fault
  7. The decision for each broker
  8. Questions asked

You type a broker hostname into the MQTT device's address field in the DeviceBridge app, run the connection test, and it fails without one packet leaving the ctrlX CORE. That is input validation, not networking: the release in the reported case accepts only a numeric address in that field, and the vendor's support reply confirmed that hostnames are refused. The fix for the plain public broker is three settings: the resolved numeric address, port 1883, and SSL Protocol set to None with Certificate set to None. The connection to the broker app on the same controller stayed down after that change, and it should have, because it is a separate fault in listener exposure, TLS or session credentials that a working public test proves nothing about.

The address field rejects hostnames before any packet leaves #

An input-validation rejection is the earliest failure an app can produce. The value is refused when the configuration is saved or tested, so no DNS query goes out, no TCP connection opens, and the broker log stays empty. Two things follow. A packet capture is useless for this fault, because there is nothing to capture. And no firewall rule, route or broker setting can fix it, because the failure never reaches them.

The confirmation is a single test: put a numeric address in the same field and run the connection test again. If the app now attempts a connection, the validation was the entire problem. The same class of failure appears when an MQTT sink stays offline until you use the broker IP address: the software wants a numeric destination and treats a name as invalid input.

The vendor stated the validation would be enhanced in upcoming releases and later noted MQTT changes in recent ARM versions, without naming a build. Record the installed app version and firmware build before you plan around hostname support; the release tested in the reported case does not have it.

Resolve the hostname with the DNS service the host uses #

The address you enter must be one the controller running the app can route to, so resolve the name the way that controller would: through its own DNS service, or from a workstation on the same network when the controller offers no lookup. In the reported case the vendor supplied 3.120.66.120 for the public broker name, and the connection succeeded with that entry. Treat such an address as a point-in-time test value, not a permanent mapping: a public name's answer can change, and one name can return several addresses. When a working connection later fails, compare the stored address with a fresh lookup before you touch anything else.

Two follow-ons. For a broker inside the plant network, giving it a fixed address is the same decision as whether a local MQTT broker needs a static IP address: a numeric entry pins the destination, so the destination has to hold still. And TLS changes the picture, because a server certificate normally identifies a hostname; connecting by address can fail the certificate identity check unless the client sends the server name or the certificate covers that address.

Port, SSL Protocol and certificate must match the listener #

Port numbers are conventions, not switches. Port 1883 is the registered default for plain MQTT and 8883 the registered default for MQTT over TLS, but the listener's configuration decides what a port actually speaks; typing a different number encrypts nothing. In this app the transport is described by two settings, SSL Protocol and Certificate, and the working public combination from the reported case is both set to None on the plain port.

That combination sends the MQTT connection request immediately after the TCP handshake. A TLS listener instead waits for a TLS handshake and cannot read those bytes; a client that starts TLS against a plain listener is equally unreadable to it. Either mismatch surfaces as a generic connection failure, which is why you match transport before you touch credentials.

One caution belongs here. Plain MQTT is unencrypted and unauthenticated, so every payload on that path is readable and the broker cannot verify who sent it. Use the plain public broker only to prove connectivity with nonsensitive test data; production traffic stays on the TLS listener with its credentials.

Where the connection stops #

Run the checks in this order and stop at the first failure; everything after it is untested until it passes.

  1. The address field accepts the value: validation, not networking.
  2. A route exists from the controller to the destination address.
  3. The broker listener is bound to that address and port, and a firewall permits the TCP connection.
  4. The transport matches, plain or TLS, and the certificate chain and identity validate.
  5. The broker accepts the session with the username, password and ClientId the listener requires.
  6. The subscription is accepted and a known publication arrives.

The temperature value you are after appears only after the sixth check passes.

Observed boundary Configuration area Next check
Hostname refused at input App address validation Installed release and its numeric-address requirement
No TCP connection Address, route, firewall, listener binding Destination interface and listening port
TCP connects, TLS fails Transport mismatch or certificate Listener mode, trust chain, certificate identity, controller clock
Transport up, session refused Authentication and session settings Broker rejection detail, username, password, ClientId
Session up, no value Subscription, topic access, publisher, tag mapping Subscription acceptance and a known publication

While the app runs its connection test, watch the broker's log or an authorized capture and note the last stage that succeeded.

Worked example: the public broker test with a numeric address #

Inputs, each with its source:

  • Broker hostname: broker.hivemq.com, the destination named in the reported case.
  • Numeric address: 3.120.66.120, supplied in the vendor's support reply for that case.
  • Port: 1883, the plain-MQTT port used for the public broker in that case.
  • SSL Protocol: None, from the vendor's support reply.
  • Certificate: None, from the vendor's support reply.

Rule, in words: the installed release validates the address field as a numeric dotted address, a value with letters in it is refused at input, so the hostname is replaced by a numeric answer the controller can route to, and the transport settings must describe the listener as configured, plain on the public port.

Arithmetic:

  • broker.hivemq.com contains letters, so it fails the numeric validation and no connection is attempted.
  • 3.120.66.120 splits into four decimal octets, 3, 120, 66 and 120; each lies within the valid 0 to 255 range, so the value passes validation.
  • Port 1883 with SSL Protocol None and Certificate None sends plain MQTT, which matches the public listener as described in the case.

Result: the tester reported the connection succeeded immediately after the address change. That is a reported test result for that release on that day, not a permanent statement about the address.

Decision: a pass here closes the public case. Stop work on the app's network path and the public destination, and spend every remaining minute on the local broker. A failure with a valid numeric address in place means the route is blocked or the installed release is not the one described here; record the app version and run check two before anything else.

The secure local broker is a separate fault #

The public test proves one thing: the app can open an outbound connection from that controller. The Cedalo MQTT Broker app on the same ctrlX CORE is reached through a different interface, and a broker process running there does not by itself mean its listener is exposed at the address you enter; the interface question follows from the earlier choice of running an MQTT broker in the PLC or on a separate device. Read the listener's bind address, port and mode from the broker app's own configuration before changing anything in the client.

For the secure connection the reported case asked for, the listener expects TLS on port 8883 plus a username, password and ClientId at session setup. Those settings do different jobs: port and transport get bytes delivered, the trust material decides whether the broker's certificate is believed, ClientId names the session, and username with password authenticates it. None substitutes for another, and a broker can require all of them. The client-side fields involved are the ones walked through for configuring an SSL broker connection in a PLC MQTT library: trust material, server name and port, set to agree with the listener.

If the installed release offers no fields for the credentials and no usable TLS option, that is a limit of the release, not a setting you missed. The vendor pointed to MQTT enhancements in recent ARM versions without naming a build, so take the recorded app and firmware versions to product support and get the supported update. What you must not do is reconfigure the broker's secure listener down to plain MQTT so the app connects: that strips encryption and authentication from a production path, a security downgrade dressed as a fix.

The decision for each broker #

  • Public plain broker, connectivity test only: fresh lookup, the numeric address in the address field, the plain port, SSL Protocol None, Certificate None. Refresh the address when the lookup changes, and keep the payloads nonsensitive, because that path has no encryption and no authentication.
  • Local secure broker, the production path: keep its TLS listener as configured. Verify bind address, port and firewall first, then set the client's transport, trust material, username, password and ClientId to match. Where the release lacks those fields, update through the vendor's support with the recorded versions; never downgrade the listener.
  • Hostname support: absent from the tested release. Assume the numeric requirement until the vendor confirms otherwise for your exact app and firmware combination.

Questions asked

How do I convert a broker hostname into a numeric address?

Run a name lookup against the same DNS service the controller uses, for example nslookup with the broker name from a workstation on that network, and read the address it returns. Public names can return several addresses or change over time, so treat any address quoted in an old report as historical until a fresh lookup confirms it, and repeat the lookup whenever a stored entry stops working.

Why can entering an address break the TLS connection later?

A TLS client compares the name it dialed against the server certificate. Dialed by hostname, the check matches the certificate's name entries; dialed by address, the client must find that exact address in the certificate, which public brokers rarely include. Where the app allows it, keep TLS sessions on the hostname, or have the broker certificate issued to cover the address you must dial.

Does the working public test prove the app can reach the local broker?

No. The public test exercises the controller's outbound route to the internet. The broker app on the same controller sits behind a local interface that public traffic never touches, so its listener binding, port, firewall rule and security mode are all still unproven. Configure and test the two connections as independent items, in the order the connection checks run.

Which release accepts broker hostnames?

None is documented by number. The vendor said the validation would be enhanced in upcoming releases and later asked which ARM version was in use because MQTT had changed in recent ones, without naming a build. Record the installed app version and firmware build, and put that combination to the vendor's product support before assuming a hostname will pass validation.

Keep reading

  • Explainer

    Does a local MQTT broker need a static IP address

    No. A local MQTT broker needs a stable endpoint, not a static address specifically: point every client at a fixed IP or at a hostname that dynamic DNS keeps mapped to the broker's current address. After any address change, verify DNS resolution and an actual MQTT connect from each remote unit; VPN and firewall choices are a separate security decision.

    Edge computing and IIoT

  • Troubleshooting

    MQTT sink stays offline until you use the broker IP address

    Your MQTT sink never reaches Online because localhost names the connector runtime's own loopback interface, not the broker. A pub/sub test from a separate client proves only that client's path. Replacing localhost with the broker's reachable IP address restored Online in the reported installation.

    Edge computing and IIoT

  • Troubleshooting

    Node-RED MQTT fails when the broker rejects plain MQTT

    The connect fails because the MQTT OUT broker configuration sends plain MQTT while the Mosquitto listener accepts TLS only; the address and port can be correct and it still fails. Confirm which side is at fault with MQTT Explorer, then pick one mode on both ends — enable the plain listener you intend, or enable TLS in the client — and verify with a same-topic publish and subscribe.

    Edge computing and IIoT

Why Mosquitto 2.0 rejects a Telegraf MQTT output: identifier rejected