S
stupidnic
Guest
I have been having a problem with a particular client all day. It seems their ISP's name servers have stopped handing out responses for the IP address. So I went ahead and added the -Rt0 to the inetd.conf (this is a Debian server) and restarted inetd.conf.
This didn't fix the problem so I thought I had some sort of problem with the mail server itself. I went round and round and I have finally determined that even though tcp-env is passed the -Rt0 switch (I have also tried just -R) it still does the reverse DNS lookup.
Here is a stack trace of inetd spawning off tcp-env and its subsequent calls to the resolv.conf and DNS calls out to the DNS server.
As you can see -Rt0 is being passed as an option to tcp-env.
Later in the same process we can see tcp-env parsing the resolv.conf:
and then making the call out to the remote DNS server:
This has been driving me crazy. I have even gone so far as to start picking through the tcp-env.c file in the qmail+plesk source code, but it looks correct (even if my C skills are a tad rusty).
I see the same thing on a CentOS 5 based Plesk install of 8.2... I am at a loss why it is doing this when it is specifically told not to.
This didn't fix the problem so I thought I had some sort of problem with the mail server itself. I went round and round and I have finally determined that even though tcp-env is passed the -Rt0 switch (I have also tried just -R) it still does the reverse DNS lookup.
Here is a stack trace of inetd spawning off tcp-env and its subsequent calls to the resolv.conf and DNS calls out to the DNS server.
Code:
[pid 2334] execve("/var/qmail/bin/tcp-env", ["tcp-env", "-Rt0", "/var/qmail/bin/relaylock", "/var/qmail/bin/qmail-smtpd", "/var/qmail/bin/smtp_auth", "/var/qmail/bin/true", "/var/qmail/bin/cmd5checkpw", "/var/qmail/bin/true"], [/* 16 vars */]) = 0
As you can see -Rt0 is being passed as an option to tcp-env.
Later in the same process we can see tcp-env parsing the resolv.conf:
Code:
[pid 2334] open("/etc/resolv.conf", O_RDONLY) = 3
[pid 2334] fstat64(3, {st_mode=S_IFREG|0644, st_size=69, ...}) = 0
[pid 2334] mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d2a000
[pid 2334] read(3, "search domain.net\nnameserve"..., 131072) = 69
[pid 2334] read(3, "", 131072) = 0
[pid 2334] close(3) = 0
and then making the call out to the remote DNS server:
Code:
[pid 2334] socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
[pid 2334] connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("1.2.3.4")}, 28) = 0
[pid 2334] send(3, "\202\253\1\0\0\1\0\0\0\0\0\0\00237\00281\003210\003207"..., 44, 0) = 44
[pid 2334] gettimeofday({1188954458, 39940}, NULL) = 0
[pid 2334] poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 5000) = 1
[pid 2334] recvfrom(3, "\202\253\201\200\0\1\0\1\0\0\0\0\00237\00281\003210\003"..., 513, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("1.2.3.4")}, [16]) = 82
[pid 2334] close(3)
This has been driving me crazy. I have even gone so far as to start picking through the tcp-env.c file in the qmail+plesk source code, but it looks correct (even if my C skills are a tad rusty).
I see the same thing on a CentOS 5 based Plesk install of 8.2... I am at a loss why it is doing this when it is specifically told not to.