Difference between revisions of "Netdb"

From Free Pascal wiki
Jump to navigationJump to search
(Categorization)
(Language)
Line 1: Line 1:
 
{{Netdb}}
 
{{Netdb}}
  
Netdb is a simple library for DNS resolving under *nix. It forms the basis of FCL level DNS resolving which is truely platform independant.  
+
==Overview==
 +
Netdb is a simple library for DNS resolving under *nix. It forms the basis of FCL level DNS resolving which is truly platform independent.  
  
After being broken for a while, after 1.9.8 some serious fixes were made, and now the IPV4 calls should be in at least usable form for FreeBSD/Linux/Darwin on x86 and powerpc.
+
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.  
  
The most common misconception about netdb is that the 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.  
+
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.  
  
 
This has the following consequences:
 
This has the following consequences:
* it takes two calls to resolve a name (one to check hosts, one to check dns) (i.o.w. testdns and testhost code is both needed)
+
* 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)
 
* the LOOKUP (OpenBSD) command in resolv.conf is not processed.
 
* the LOOKUP (OpenBSD) command in resolv.conf is not processed.
* Other forms of resolving than /etc/hosts and (like YP) are not supported.
+
* Other forms of resolving than /etc/hosts and (like YP/Yellow Pages) are not supported.
 
* Setting FPC_USE_LIBC doesn't have any consequences yet, the non-libc code will still be used.
 
* Setting FPC_USE_LIBC doesn't have any consequences yet, the non-libc code will still be used.
  
 
[[Category:Unix]]
 
[[Category:Unix]]
 
[[Category:FCL]]
 
[[Category:FCL]]

Revision as of 10:19, 1 October 2013

English (en) Bahasa Indonesia (id)

Overview

Netdb is a simple library for DNS resolving under *nix. It forms the basis of FCL level DNS resolving which is truly platform independent.

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.

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.

This has the following consequences:

  • 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)
  • the LOOKUP (OpenBSD) command in resolv.conf is not processed.
  • Other forms of resolving than /etc/hosts and (like YP/Yellow Pages) are not supported.
  • Setting FPC_USE_LIBC doesn't have any consequences yet, the non-libc code will still be used.