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 (

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).

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine



James Long <[EMAIL PROTECTED]> wrote on 02/27/2006 04:26:37 PM:

> You seem to be unaware of /etc/hosts.
> 
> > Yes, there is a very good, not so technical reason to only allow 
binding 
> > by IP Address.  Have you ever heard of "putting the cart before the 
horse" 
> > ?
> > 
> > If binding by hostname were allowed, that would mean that every time 
your 
> > MySQL server started up, it would need to somehow resolve that name 
into 
> > an address. In order to do that, it needs a socket it can use to 
contact a 
> > DNS server in order to change the hostname back into an address. Where 

> > does it get the socket? Without a socket, it cannot contact a DNS 
server 
> > so it cannot resolve it's hostname to an address and it will not be 
able 
> > to bind to a socket.
> 
> I can't speak for your machine, but on my servers, DNS is up before 
> MySQL starts.
> 
> > Binding is the process of giving a socket (an address and a port) to 
an 
> > application so that it has a point of contact on the internet. Without 
a 
> > socket an application has no way to communicate over TCP/IP or UDP/IP 
as 
> > there would be nowhere for the return messages to land. That is the 
simple 
> > reason why you cannot bind to a hostname.
> > 
> > Did I make sense?
> 
> Yes, but none of the information was new.
> 
> > Shawn Green
> > Database Administrator
> > Unimin Corporation - Spruce Pine
> > 
> > James Long <[EMAIL PROTECTED]> wrote on 02/27/2006 03:59:14 
PM:
> > 
> > > > It doesn't allow to bind to a hostname.  According to
> > > > 
> > > > http://dev.mysql.com/doc/refman/5.0/en/server-options.html
> > > > 
> > > > you have to specify an IP address, not a hostname.
> > > > 
> > > > -Sheeri
> > > 
> > > Thanks for your reply.  Yes, I am aware of that, as stated in
> > > my question.
> > > 
> > > Wouldn't it be an improvement if it did, though?  Currently, I
> > > have to use an ugly grep/awk hack to grep the address out of
> > > /etc/hosts.  Are there technical reasons that make it difficult
> > > to write the code such that one could specify an IP or a hostname,
> > > or a list of IPs and/or hostnames?
> > > 
> > > I'm looking for something similar to PostgreSQL's:
> > > 
> > > -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.
> > > 
> > > 
> > > > 
> > > > On 2/22/06, James Long <[EMAIL PROTECTED]> wrote:
> > > > > I would like to be able to bind to a host name, rather than
> > > > > an IP number.  IP numbers come and go, and are beyond the
> > > > > control of anyone who doesn't have their own direct allocation.
> > > > > But since I own my domain, a host name is more permanent.
> > > > >
> > > > > When the time comes to change IP numbers, I want to just edit
> > > > > /etc/hosts to show my new IP:
> > > > >
> > > > > 10.0.0.10       shortname myrealname.example.com
> > > > >
> > > > > and use "--bind-address=shortname" in my start-up script to
> > > > > automatically pick up the new IP number.
> > > > >
> > > > > This eliminates the headache of having to find and fix umpteen
> > > > > literal IP numbers hiding in my startup scripts.  This is much
> > > > > the same reason one says '#define BLKSIZ 512' and then uses the
> > > > > constant 'BLKSIZ' instead of sprinkling literal '512's 
throughout
> > > > > one's code).
> > > > >
> > > > > Why doesn't bind-address allow this?  Or if it does, how can I
> > > > > accomplish this?
> > > > >
> > > > >
> > > > > Thanks!
> > > > >
> > > > >
> > > > > Jim
> > > > >
> > > > > --
> > > > > MySQL General Mailing List
> > > > > For list archives: http://lists.mysql.com/mysql
> > > > > To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]
> > > > >
> > > > >
> > > > 
> > > 
> > > 
> > > -- 
> > > MySQL General Mailing List
> > > For list archives: http://lists.mysql.com/mysql
> > > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
> > > 
> > 
> > --=_alternative 0075136A85257122_=
> > Content-Type: text/html; charset="US-ASCII"
> > 
> > 
> > <br><font size=2 face="sans-serif">Yes, there is a very good, not 
> so technical
> > reason to only allow binding by IP Address. &nbsp;Have you ever heard 
of
> > &quot;putting the cart before the horse&quot; ?</font>
> > <br>
> > <br><font size=2 face="sans-serif">If binding by hostname were 
allowed,
> > that would mean that every time your MySQL server started up, it would
> > need to somehow resolve that name into an address. In order to do 
that,
> > it needs a socket it can use to contact a DNS server in order to 
change
> > the hostname back into an address. Where does it get the socket? 
Without
> > a socket, it cannot contact a DNS server so it cannot resolve it's 
hostname
> > to an address and it will not be able to bind to a socket.</font>
> > <br>
> > <br><font size=2 face="sans-serif">Binding is the process of giving a 
socket
> > (an address and a port) to an application so that it has a point of 
contact
> > on the internet. Without a socket an application has no way to 
communicate
> > over TCP/IP or UDP/IP as there would be nowhere for the return 
messages
> > to land. That is the simple reason why you cannot bind to a 
hostname.</font>
> > <br>
> > <br><font size=2 face="sans-serif">Did I make sense?</font>
> > <br>
> > <br><font size=2 face="sans-serif">Shawn Green<br>
> > Database Administrator<br>
> > Unimin Corporation - Spruce Pine</font>
> > <br>
> > <br><font size=2><tt>James Long &lt;[EMAIL PROTECTED]&gt; 
wrote
> > on 02/27/2006 03:59:14 PM:<br>
> > <br>
> > &gt; &gt; It doesn't allow to bind to a hostname. &nbsp;According 
to<br>
> > &gt; &gt; <br>
> > &gt; &gt; 
http://dev.mysql.com/doc/refman/5.0/en/server-options.html<br>
> > &gt; &gt; <br>
> > &gt; &gt; you have to specify an IP address, not a hostname.<br>
> > &gt; &gt; <br>
> > &gt; &gt; -Sheeri<br>
> > &gt; <br>
> > &gt; Thanks for your reply. &nbsp;Yes, I am aware of that, as stated 
in<br>
> > &gt; my question.<br>
> > &gt; <br>
> > &gt; Wouldn't it be an improvement if it did, though? &nbsp;Currently,
> > I<br>
> > &gt; have to use an ugly grep/awk hack to grep the address out of<br>
> > &gt; /etc/hosts. &nbsp;Are there technical reasons that make it 
> difficult<br>
> > &gt; to write the code such that one could specify an IP or a 
hostname,<br>
> > &gt; or a list of IPs and/or hostnames?<br>
> > &gt; <br>
> > &gt; I'm looking for something similar to PostgreSQL's:<br>
> > &gt; <br>
> > &gt; -h hostname<br>
> > &gt; &nbsp; &nbsp;Specifies the IP host name or address on which 
> the postmaster
> > is<br>
> > &gt; &nbsp; &nbsp;to &nbsp;listen &nbsp;for TCP/IP connections from 
client
> > applications. The<br>
> > &gt; &nbsp; &nbsp;value can also be a space-separated list of 
addresses,
> > or &nbsp;* &nbsp;to<br>
> > &gt; &nbsp; &nbsp;specify &nbsp;listening &nbsp;on &nbsp;all available
> > interfaces. An empty value<br>
> > &gt; &nbsp; &nbsp;specifies not listening on any IP addresses, in 
which
> > case &nbsp;only<br>
> > &gt; &nbsp; &nbsp;Unix-domain &nbsp;sockets &nbsp;can &nbsp;be used to
> > connect to the postmaster.<br>
> > &gt; &nbsp; &nbsp;Defaults to listening only on localhost. 
&nbsp;Specifying
> > this option<br>
> > &gt; &nbsp; &nbsp;is &nbsp;equivalent &nbsp;to &nbsp;setting &nbsp;the
> > &nbsp;listen_addresses configuration<br>
> > &gt; &nbsp; &nbsp;parameter.<br>
> > &gt; <br>
> > &gt; <br>
> > &gt; &gt; <br>
> > &gt; &gt; On 2/22/06, James Long &lt;[EMAIL PROTECTED]
> com&gt; wrote:<br>
> > &gt; &gt; &gt; I would like to be able to bind to a host name, 
> rather than<br>
> > &gt; &gt; &gt; an IP number. &nbsp;IP numbers come and go, and are 
beyond
> > the<br>
> > &gt; &gt; &gt; control of anyone who doesn't have their own direct
> allocation.<br>
> > &gt; &gt; &gt; But since I own my domain, a host name is more 
permanent.<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt; When the time comes to change IP numbers, I want to 
just
> > edit<br>
> > &gt; &gt; &gt; /etc/hosts to show my new IP:<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt; 10.0.0.10 &nbsp; &nbsp; &nbsp; shortname 
> myrealname.example.com<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt; and use &quot;--bind-address=shortname&quot; in my 
start-up
> > script to<br>
> > &gt; &gt; &gt; automatically pick up the new IP number.<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt; This eliminates the headache of having to find and 
> fix umpteen<br>
> > &gt; &gt; &gt; literal IP numbers hiding in my startup scripts. 
&nbsp;This
> > is much<br>
> > &gt; &gt; &gt; the same reason one says '#define BLKSIZ 512' and then 
uses
> > the<br>
> > &gt; &gt; &gt; constant 'BLKSIZ' instead of sprinkling literal 
> '512's throughout<br>
> > &gt; &gt; &gt; one's code).<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt; Why doesn't bind-address allow this? &nbsp;Or if it 
does,
> > how can I<br>
> > &gt; &gt; &gt; accomplish this?<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt; Thanks!<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt; Jim<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt; --<br>
> > &gt; &gt; &gt; MySQL General Mailing List<br>
> > &gt; &gt; &gt; For list archives: http://lists.mysql.com/mysql<br>
> > &gt; &gt; &gt; To unsubscribe: &nbsp; &nbsp;http://lists.mysql.
> com/[EMAIL PROTECTED]<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; &gt;<br>
> > &gt; &gt; <br>
> > &gt; <br>
> > &gt; <br>
> > &gt; -- <br>
> > &gt; MySQL General Mailing List<br>
> > &gt; For list archives: http://lists.mysql.com/mysql<br>
> > &gt; To unsubscribe: &nbsp; &nbsp;http://lists.mysql.com/mysql?
> [EMAIL PROTECTED]<br>
> > &gt; <br>
> > </tt></font>
> > --=_alternative 0075136A85257122_=--
> > 
> 

Reply via email to