PJSIP DNS Resolution with /etc/hosts, Asterisk 12.4

I’m using Asterisk 12.4.0 with chan_pjsip, and having trouble resolving a domain with /etc/hosts .

When sending calls to a specific uri, we would like to resolve the domain using an /etc/hosts entry. When I ping the domain from the server, it resolves per my hosts file. But when sending the call, the INVITE is always sent to the IP that resolves with a regular DNS lookup, as if pjsip ignores the hosts file.

Is there some config parameter to ensure that PJSIP first checks the hosts file?


The PJSIP resolver does not support using /etc/hosts. As of Asterisk 14 we use our own pluggable resolver and both implementations, unbound and system, support using /etc/hosts.

1 Like

Ah, understood! Thank you for the quick explanation!