[OpenSIPS-Users] How can I prevent Opensips to cache DNS queries.

Mundkowsky, Robert rmundkowsky at ets.org
Thu May 11 18:42:19 EDT 2017


Also you can try removing "dns" from your nsswitch.conf file or hard coding the bad server name in the hosts file (remember to use ipv4 and ipv6 if needed).

Robert

From: Users [mailto:users-bounces at lists.opensips.org] On Behalf Of Mundkowsky, Robert
Sent: Thursday, May 11, 2017 6:39 PM
To: OpenSIPS users mailling list <users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] How can I prevent Opensips to cache DNS queries.

Is there a name server running on your box?


man7.org/linux/man-pages/man5/resolv.conf.5.html says "If this file does not exist, only the name server on the local machine will be queried
"

Robert

From: Users [mailto:users-bounces at lists.opensips.org] On Behalf Of Stefan Carlsson
Sent: Thursday, May 11, 2017 4:50 AM
To: OpenSIPS users mailling list <users at lists.opensips.org<mailto:users at lists.opensips.org>>
Subject: Re: [OpenSIPS-Users] How can I prevent Opensips to cache DNS queries.

Hi !

Thanks for your reply.

I did the following.


1)      I've checked my nsswitch.conf file and it says 'files  dns' as in default , so no change there.

2)      I "disabled the resolver" but simply commented out the dns servers in resolv.conf, checked the resolver by a simple ping to www.google.com<http://www.google.com>, got the response: 'unknown host' as it should.

3)      Then I've put our SIP operators ip-name pairs in the hosts file, EXCEPT the one that causes us problem , checked with ping , got hits on all of them, and the one that where the problem responded with 'unknown host',

so the system looks up the hosts file correctly.

4)      But STILL Opensips uses the faulty one , the IP is not in the hosts file, no dns servers is in the resolv.conf.

5)      Restarts the Opensips, now it works as expected.

Can anyone out there give me an explanation that causes this behavior ?


Again, thank you for your attend at this matter.


Kind Regards / Vänligen ...

Stefan Carlsson


From: Users [mailto:users-bounces at lists.opensips.org] On Behalf Of Mundkowsky, Robert
Sent: den 10 maj 2017 15:13
To: OpenSIPS users mailling list <users at lists.opensips.org<mailto:users at lists.opensips.org>>
Subject: Re: [OpenSIPS-Users] How can I prevent Opensips to cache DNS queries.

What do you mean you "disabled the resolver"?

I haven't play with this in a long time, but I think the /etc/nsswitch.conf file defines if you use /etc/hosts file or/and DNS for looking up host names, and might allow nis+ as well, but I can't remember.

So might want to check if you happen to have your hostname defined in the hosts file.  Also seems people note that /etc/resolv.conf might be overwrite at boot based on using NetworkManager.  So maybe your settings are being over written.

Robert

From: Users [mailto:users-bounces at lists.opensips.org] On Behalf Of Stefan Carlsson
Sent: Tuesday, May 9, 2017 5:36 AM
To: Users at lists.opensips.org<mailto:Users at lists.opensips.org>
Subject: [OpenSIPS-Users] How can I prevent Opensips to cache DNS queries.

Hi !

It seems that the Opensip 2.2 caches DNS queries !!!

Even after I disabled the resolver in Centos, the OpenSIPs seems to "remember" old queries. (eg. IP's)
after a Opensip restart, the old stuff was gone.

If so, how can I disable the DNS caching in the Opensips, I want the system to always make a new , fresh
query.


Kind Regards / Vänligen ...

Stefan Carlsson


________________________________

This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


Thank you for your compliance.

________________________________

________________________________

This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


Thank you for your compliance.

________________________________

________________________________

This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


Thank you for your compliance.

________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170511/dd9d89d2/attachment.html>


More information about the Users mailing list