Netdb: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Netdb
| Old | New | Line | |
|---|---|---|---|
| 1 | + | ## Overview | |
| 2 | + | ||
| 3 | + | Netdb is an unit DNS resolving under *nix, grouped in the larger [[fcl-net]] package. It forms the basis of FCL level DNS resolving which is truly platform independent. | |
| 4 | + | ||
| 5 | + | After being broken for a while, after 1.9.8 some serious fixes were made, and the IPV4 calls should be in at least usable form for FreeBSD/Linux/Darwin on x86 and PowerPC. | |
| 6 | + | ||
| 7 | + | The most common misconception about netdb is that gethostbyname is a direct alternative for the libc call with the same name (which resolves a host). However, the netdb call gethostbyname really only checks /etc/hosts, and netdb resolvename only checks the DNS servers listed in /etc/resolv.conf. | |
| 8 | + | ||
| 9 | + | This has the following consequences: | |
| 10 | + | ||
| 11 | + | - it takes two calls to resolve a name (one to check hosts, one to check DNS) (in other words testdns and testhost code is both needed) | |
| 12 | + | - the LOOKUP (OpenBSD) command in resolv.conf is not processed. | |
| 13 | + | - Other forms of resolving than /etc/hosts and (like YP/Yellow Pages) are not supported. | |
| 14 | + | - Setting FPC_USE_LIBC doesn't have any consequences yet, the non-libc code will still be used. | |
| 15 | + | ||
| 16 | + | Note that [[fcl-net]] also contains a straight libc using resolve header, cnetdb since FPC 2.2.4. | |
| 17 | + | ||
| 18 | + | --- | |
| 19 | + | *From the Free Pascal wiki, page "Netdb", as it stood on 2013-10-01 after a change by Marcov, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 20 | + | Category: FCL | |
| 21 | + | Category: Unix |
