[Serusers] When is a DNS lookup performed?

Andrei Pelinescu-Onciul pelinescu-onciul at fokus.fraunhofer.de
Fri Jun 27 13:09:55 CEST 2003


On Jun 26, 2003 at 23:26, Maxim Sobolev <sobomax at portaone.com> wrote:
> Andrei Pelinescu-Onciul wrote:
> >On Jun 26, 2003 at 12:22, Jamin W. Collins <jcollins at asgardsrealm.net> 
> >wrote:
> >
> >>When does SER perform DNS lookups?  Is it a matter of how the entry is
> >>made in the ser.cfg?  I ask because one of our customers changed their
> >>DNS servers and the SER proxy was not updated.  In the ser.cfg all
> >>routing is done by IP (or I had thought it was).  However, the site
> >>started experiencing some very odd call drops and after updating the
> >>resolv.conf on the proxy server with the proper DNS servers (one of them
> >>had changed) everything was fine.
> >
> >
> >DNS lookups for the addresses in ser.cfg are performed only once, on ser
> >startup immediately after reading the cfg. file.
> >
> >>Should IP address entries be quoted or non-quoted?
> >
> >It doesn't matter (they have to be quoted for modules functions, like
> >t_relay_to, they can be unquoted for forward*(...) ).
> >
> >>Does the presence of
> >>the quotes cause a DNS lookup even though the item in them is purely
> >>numeric (i.e. "162.128.33.54").
> >
> >No. Internal ser resolve functions will be called, but in the default
> >compilation (with -DDNS_IP_HACK added) they will recognize ipv4 & ipv6
> >addresses and no dns lookup will be performed.
> >
> >Runtime DNS lookups for requests are performed only for forward (uri:host),
> >t_relay() and other uri involving forwarding functions.
> 
> Not quite. Run-time reverse DNS lookups also performed when you are 
> doing comparisons involving src_ip.

Yes, you are right. I forgot about those.
In ser 0.8.10 comparisons with source/dest ip will always involve a rev.
dns lookup if the operand is enclosed in quotes (e.g. src_ip=="1.2.3.4"
as oposed to src_ip==1.2.3.4 or src_ip==1.2.3.4/32 which will not
involve dns lookups).
In ser 0.8.11pre* things are a little better: if an ip addr. is in
quotes it will first be compared to src_ip without any dns lookups, but
if it does not match, a rev dns on src_ip will be performed and each
alias in the result will be compared with the operand.
So if you use ip addresses in comparisons, use them without quotes,
things will run mutch faster.

Andrei



More information about the sr-users mailing list