[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with classless in-addr.arpa DNS entries
I found in 2.99.45 that "bind" type database function "revaddress"
cannot handle classless reverse mapping properly. (See
ftp://ftp.ripe.net/internet-drafts/draft-ietf-dnsind-classless-inaddr-03.txt)
Let's see an example:
% host 2.222.225.193.in-addr.arpa
2.222.225.193.in-addr.arpa CNAME 2.0.222.225.193.in-addr.arpa
2.0.222.225.193.in-addr.arpa does not exist (Authoritative answer)
This means, that hostmaster of zone 222.225.193.in-addr.arpa
already delegated a small part of 193.225.222 reverse names
but the CNAME points to nothing because the hostmaster of
0.222.225.193.in-addr.arpa zone is not set up yet his name server.
In that case we can experience funny things:
% router -i
...
z$ trace on
z$ gethostbyaddr 193.225.222.2
gethostbyaddr 193.225.222.2
revdomain 193.225.222.2
revdomain 225.222.2
revdomain 222.2
revdomain 2
echo 2
echo 2.222
echo 2.222.225
echo 2.222.225.193
%dblookup (revaddress 2.222.225.193.in-addr.arpa) <0>
echo 2.222.225.193.in-addr.arpa
2.222.225.193.in-addr.arpa
return (return) <0>
?=1
?=1
z$
Dblookup should return nothing but it returns 2.222.225.193.in-addr.arpa.
Look what happens in case of a classical nonregistered address:
z$ gethostbyaddr 1.2.3.4
gethostbyaddr 1.2.3.4
revdomain 1.2.3.4
revdomain 2.3.4
revdomain 3.4
revdomain 4
echo 4
echo 4.3
echo 4.3.2
echo 4.3.2.1
%dblookup (revaddress 4.3.2.1.in-addr.arpa) <0>
?=1
?=1
echo [1.2.3.4]
[1.2.3.4]
return (return) <0>
?=1
?=1
z$
So one can send mail to user@[1.2.3.4] but not to user@[193.225.222.2].
Fast workaround:
the gethostbyname() function in i-smtp.cf may be hacked in such a way:
gethostbyaddr (ipaddrliteral) {
local reversed
reversed=$(revdomain $ipaddrliteral)
sift $(revaddress $reversed.in-addr.arpa) in
.*\.in-addr\.arpa echo "[$ipaddrliteral]" ; return ;; # New line
.\..* echo \0 ; return ;;
.* echo "[$ipaddrliteral]" ; return ;;
tfis
}
Gabor