Dial by IP address with pjsip

I’m using Asterisk 18.x with PJSIP. My ITSP is suffering DNS issues.

How do I configure pjsip so that registration and dialing are done by /etc/hosts entries?

I imagine it will try queries that cannot be satisfied from /etc/hosts, in which case you need run BIND in caching mode (or even as a secondary name server, although these days you you are unlikely to have permission to do domain transfers.

I’n that case I will use an alternative DNS like google DNS, You can also contact your SIP carrier and verify if they have Fixed IP address for termination and origination

I assumed that the OP meant that they were faulty for the domains for which they are authoritative. If it is just their forwarding server that is faulty, you can run BIND in full fledged mode on your machine.

If they are dropping out for their own domain, and /etc/hosts won’t work, you also become unofficially authoritative, for them, but you won’t be able to resolve anything that belongs to them that isn’t in your partial copy.

That will not work. That is not a solution the problem at hand which is that the DNS servers which are authoritative for the ITSP’s domain are down.

There is no such manpage for resolve.conf. If you mean /etc/resolv.conf, then search from that file is irrelevant. It just specifies domain postfixes for non-fqdn search queries and does not relate to having Asterisk’s PJSIP use /etc/hosts.

My understanding is that PJSIP will not even consult /etc/hosts for some whatever unknown reason. Is that true? If so, what is the solution here?

You may be thinking of:

man nsswitch.conf

Which assumes that PJSIP will use the system resolver but I do not believe that is the case and it queries DNS directly.

If using bundled with 18, then it is pluggable with most people using the unbound resolver (res_resolver_unbound) which does allow use of /etc/hosts (by default it should use what the system defines as the default /etc/hosts). I don’t know about the fallback system level DNS primitives, whether they respect /etc/hosts or not.

Indeed I was, or rather its pedecessor, which only did name resolution. I will remove that part of my reply.

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