JezK
Edit File: interfacespurpose.html
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>What it does</title><link rel="stylesheet" type="text/css" href="userguide.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="home" href="index.html" title="FreeTDS User Guide" /><link rel="up" href="interfacesfile.html" title="Appendix B. The interfaces File" /><link rel="prev" href="interfaceslocation.html" title="Where it goes" /><link rel="next" href="interfacesformat.html" title="What it looks like" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">What it does</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="interfaceslocation.html">Prev</a> </td><th width="60%" align="center">Appendix B. The <code class="filename">interfaces</code> File</th><td width="20%" align="right"> <a accesskey="n" href="interfacesformat.html">Next</a></td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="interfacespurpose"></a>What it does</h2></div></div></div><p>The <code class="filename">interfaces</code> file aliases a servername to the hostname and port number of the servername's machine. When <span class="productname">FreeTDS</span> receives a request to connect to a database server, it looks up the servername in <code class="filename">interfaces</code>. There, it finds the machine name (or address) and port number to connect to, that is, the port where the database server is listening.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../images/tip.gif" /></td><th align="left">Tip</th></tr><tr><td align="left" valign="top"><div class="sidebar"><div class="titlepage"><div><div><p class="title"><strong>How's that again?</strong></p></div></div></div><p>The <code class="filename">interfaces</code> file sometimes trips people up. It seems innocuous enough, but it's also a pretty good example of <span class="quote">“<span class="quote">it's easy if you know how</span>”</span>. Keep in mind:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: bullet; "><li class="listitem" style="list-style-type: disc"><p>The <span class="emphasis"><em>servername</em></span> is the name of the database server. When a database client specifies the <span class="quote">“<span class="quote">name of the server</span>”</span> to connect to, it's the <span class="emphasis"><em>servername</em></span> that is used. </p></li><li class="listitem" style="list-style-type: disc"><p>The <span class="emphasis"><em>host name</em></span> is the name of the host (machine) where the database server is running. It has an IP address, and in almost any environment, you can <span class="command"><strong>ping</strong></span> the machine name to see if you've got it right. After it uses the <span class="emphasis"><em>servername</em></span> to look up the <span class="emphasis"><em>host name</em></span>, <span class="productname">FreeTDS</span> will do the same thing <span class="command"><strong>ping</strong></span> does to get the IP address of the machine to connect to. </p></li><li class="listitem" style="list-style-type: disc"><p>Finally, the <span class="emphasis"><em>port number</em></span> is frequently overlooked. From the network's point of view, knowing the IP address without the port number is a little like knowing the address of an apartment building without knowing the apartment number. In both cases, it will be hard to find what you came for. Make sure you <span class="emphasis"><em>know</em></span> the port number, and that it's correctly entered in the <code class="filename">interfaces</code> file. </p></li></ul></div></div></td></tr></table></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="interfaceslocation.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="interfacesfile.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="interfacesformat.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Where it goes </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> What it looks like</td></tr></table></div></body></html>