Problem: long delay (10 sec) between asterisk take a call and dial to remote extension.
Now use realtime pjsip config (for endpoints, aors, auth, contacts) but non-realtime (all in pjsip.conf) has same behavior. Same as aster 15.6
The DNS client can cache the result for a period of time, even a negative one, to reduce the impact. If STUN is being used that can also cause a delay if that server is unreachable. And res_pjsip may use/do things differently causing it. Ultimately you need to verify that DNS is working on the system for all upstreams, and that everything resolves as you expect - including the hostname of the server.
You mean DNS client on asterisk server?
Cause ping it from himself has no delay from DNS server
PING test-s-aster01 (10.168.2.105) 56(84) bytes of data.
64 bytes from test-s-aster01 (10.168.2.105): icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from test-s-aster01 (10.168.2.105): icmp_seq=2 ttl=64 time=0.072 ms
64 bytes from test-s-aster01 (10.168.2.105): icmp_seq=3 ttl=64 time=0.077 ms
64 bytes from test-s-aster01 (10.168.2.105): icmp_seq=4 ttl=64 time=0.068 ms
64 bytes from test-s-aster01 (10.168.2.105): icmp_seq=5 ttl=64 time=0.082 ms