DNS

"No such host" in Asterisk

Asterisk could not resolve the hostname it was asked to dial, so no channel was ever created. Before blaming DNS, note that a real DNS failure would break every call on the box - not one route.

What it looks like in the log

[2026-08-17 08:55:14] WARNING[2288][C-00000144] chan_sip.c: No such host: trunk-

What it means

The lookup failed at getaddrinfo(), which means the name never resolved to an address and the leg died before any SIP traffic was attempted.

The hostname printed in the warning is the whole diagnosis. Look at the example above: trunk- is not a hostname anyone configured. It is the remains of a dial string built from a variable that resolved to nothing, leaving the prefix behind.

Most common causes

  1. 01A variable that resolved empty inside the host part

    The dominant cause. A dial string like SIP/${NUM}@trunk-${REGION} with an empty region produces exactly the truncated name above.

  2. 02A typo in the peer or trunk name

    A name that does not exist in the config and is not resolvable as a hostname either falls through to a DNS lookup and fails here.

  3. 03A peer name Asterisk treated as a hostname

    If the named peer is not defined, Asterisk assumes it must be a host and tries to resolve it. The warning is about DNS but the cause is a missing peer definition.

  4. 04A genuine DNS problem

    Real, but rare, and identifiable by scope: it affects everything at once rather than a single route. If only one destination fails, DNS is working.

  5. 05An IPv6-only or SRV-only record

    A host that publishes only records the current configuration will not use can fail to resolve in a way that looks like absence.

How to tell which one it is

Read the hostname in the warning literally and ask whether it is a name anyone would have written. Truncated names, trailing hyphens, doubled separators and stray characters all point at variable substitution rather than at DNS.

Then check whether other calls on the same box succeeded at that timestamp. If they did, name resolution on the host is fine and the problem is the string, not the resolver.

How to fix it

Related failures