View Issue Details

IDProjectCategoryView StatusLast Update
0034480FPCOtherpublic2019-09-07 17:03
ReporterAlexander KelnerAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformX64OSLinuxOS Version
Product VersionProduct Build 
Target VersionFixed in Version3.3.1 
Summary0034480: incorrect behaviour of netdb.ResolveHostByAddr
Descriptionnetdb.ResolveHostByAddr returns wrong result for reverse DNS lookups, when DNS respond is legal but curly.


Steps To Reproduce> nslookup 8.8.8.8
8.8.8.8.in-addr.arpa name = google-public-dns-a.google.com.


> nslookup 188.93.111.66
66.111.93.188.in-addr.arpa canonical name = 66.64/26.111.93.188.in-addr.ar.
66.64/26.111.93.188.in-addr.arpa name = RbNet.kstu-kai.ru.


> ./test

8.8.8.8 [google-public-dns-a.google.com]
188.93.111.66 [NODOMAIN]

=========================================
program test;
uses netdb,sockets;

function host_by_ip(ip_str: string): string;
var
   phe: THostEntry;
   domain: string;
begin
   if netdb.ResolveHostByAddr(in_addr(StrToHostAddr(ip_str)),phe)
      then domain:=phe.name
      else domain:='NODOMAIN';
   host_by_ip:=domain;
end;

var ip: string;
begin
   ip:='8.8.8.8';
   writeln(ip,' [',host_by_ip(ip),']');

   ip:='188.93.111.66';
   writeln(ip,' [',host_by_ip(ip),']');
end.

TagsNo tags attached.
Fixed in Revision42934
FPCOldBugId
FPCTarget3.2.0
Attached Files

Activities

Maxim Ganetsky

2018-10-30 00:32

reporter   ~0111667

This issue belongs to FPC project. Moving.

Bart Broersma

2018-11-09 18:13

reporter   ~0111883

Related to 0022605?

Michael Van Canneyt

2019-09-07 17:03

administrator   ~0117973

Fixed.
Problem was that apparently PTR requests can also return a CName, which must also be handled recursively.

Issue History

Date Modified Username Field Change
2018-10-29 22:35 Alexander Kelner New Issue
2018-10-30 00:32 Maxim Ganetsky Note Added: 0111667
2018-10-30 00:32 Maxim Ganetsky Project Packages => FPC
2018-10-31 09:30 Michael Van Canneyt Assigned To => Michael Van Canneyt
2018-10-31 09:30 Michael Van Canneyt Status new => assigned
2018-11-09 18:13 Bart Broersma Note Added: 0111883
2019-09-07 17:03 Michael Van Canneyt Status assigned => resolved
2019-09-07 17:03 Michael Van Canneyt Resolution open => fixed
2019-09-07 17:03 Michael Van Canneyt Fixed in Version => 3.3.1
2019-09-07 17:03 Michael Van Canneyt Fixed in Revision => 42934
2019-09-07 17:03 Michael Van Canneyt FPCTarget => 3.2.0
2019-09-07 17:03 Michael Van Canneyt Note Added: 0117973