Domain resolution lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- dstritt · 2016-11-29 11:28 Hello, I am attempting to resolve a domain name to a standard IP address string format, but I am at a loss on how to do this. I searched the forums but just came up with results referencing units that don't seem to come with fpc anymore. My program I am working on now functions fine with dotted ip addresses, but not domain names. Can someone please help? Thanks Daniel ---------------------------------------------------------------------- Leledumbo · 2016-11-29 11:36 This example is compilable and working: http://svn.freepascal.org/svn/fpc/tags/release_3_0_0/packages/fcl- net/examples/testdns.pp ---------------------------------------------------------------------- dstritt · 2016-11-29 13:27 testdns.pas(20,6) Fatal: Can't find unit netdb used by testdns Sorry, I'm kinda new to fpc. Is this unit a 3rd party unit? ---------------------------------------------------------------------- Remy Lebeau · 2016-11-29 20:41 Quote from: dstritt on November 29, 2016, 12:28:15 pmHello, I am attempting to resolve a domain name to a standard IP address string format, but I am at a loss on how to do this. Most platforms support the getaddrinfo() and inet_ntop() functions (or equivilents) for that purpose.  Pass the domain name to getaddrinfo() to get a linked list of IP addresses in binary format, and then pass the binary IPs to inet_ntop() to get their string representations. ---------------------------------------------------------------------- Remy Lebeau · 2016-11-29 20:44 Quote from: dstritt on November 29, 2016, 02:27:43 pmtestdns.pas(20,6) Fatal: Can't find unit netdb used by testdns Sorry, I'm kinda new to fpc. Is this unit a 3rd party unit? No, it is part of the FCL's fcl-net package. ---------------------------------------------------------------------- Leledumbo · 2016-11-30 07:29 Quote from: dstritt on November 29, 2016, 02:27:43 pmtestdns.pas(20,6) Fatal: Can't find unit netdb used by testdns Sorry, I'm kinda new to fpc. Is this unit a 3rd party unit? No, and has been shipped with FPC since 2.2.2. Either your installation is incomplete or your configuration doesn't cover the path to that unit directory.