> Oh, no. I know about etc/hosts (even Windoze boxes has one). It's just > normally not available for reference until you bind your socket library to > at least one socket. Again, it's a cart and horse thing. You see, the > etc/hosts file counts as a "local" DNS server and the DNS protocol > requires a socket (
But an *outgoing* socket for DNS lookups is different from the "listening" address the server binds to. > I am not aware of any IP stack that will allow an etc/hosts lookup until > you have at least one socket established (though I could be wrong). Look, with all due respect to your experience, I can assure you that none of this is rocket science, nor is it a chicken-and-egg sort of problem. It's not impossible to do. Other databases do it. IANASE, but I should think a simple call to gethostbyname(3) should do the trick: The structure returned contains either the information obtained from the name server, named(8), broken-out fields from a line in /etc/hosts, or database entries supplied by the yp(8) system. The order of the lookups is controlled by the `hosts' entry in nsswitch.conf(5). PostgreSQL's -h option is an example of the functionality I'm trying to find in MySQL, as I posted in an earlier message (on which you were not yet cc'ed, and which may not have hit the list yet). It allows the administrator to specify a *list* of IPs *OR* hostnames that the database server should bind to for incoming client connections: "-h hostname Specifies the IP host name or address on which the postmaster is to listen for TCP/IP connections from client applications. The value can also be a space-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the postmaster. Defaults to listening only on localhost. Specifying this option is equivalent to setting the listen_addresses configuration parameter." So I could start Postgres with "-h localhost priv pub sql.example.com" and bind to those IPs. Further, if those DNS names resolve to multiple IPs, then Postgres will bind to as many of them as it can find on the local machine. How do I do that with MySQL? Thanks again for taking the time to answer my questions. Jim -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]