Teh Kim Chooi:
> i test the command today, and found out that it only takes 1.5 secs, nothing
> change from the 5 secs result. I add the 192.168.1.10 to my /etc/hosts file,
> and it drop to 0.5 secs to inject 100 msgs.
> 1. Question here, if the sender IP is not in my /etc/hosts, will postfix do
> a reverse lookup on the IP ? If yes, means it will affect my performance,
> any way to help to increase without adding to the /etc/hosts file.
These lookups are made by the SYSTEM LIBRARY not Postfix.
Postfix invokes the system library functions getnameinfo() (to look
up the SMTP client IP address) and getaddrinfo() (to verify that
the name thus found actually resolves to the client IP address).
The getwhateverinfo() functions use a mechanism called nsswitch or
equivalent to choose between lookups from local file, DNS, NIS,
LDAP or whatever your system has configured.
Apparently, your system looks in /etc/hosts first then DNS.
Apparently, your DNS is mis-configured, and that was responsible
for the lookup delays.