JezK
Edit File: name.lookup.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>servername Lookup</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="install.html" title="Chapter 3. Install FreeTDS" /><link rel="prev" href="ChoosingTdsProtocol.html" title="Choosing a TDS protocol version" /><link rel="next" href="freetdsconf.html" title="The freetds.conf file" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><em class="replaceable"><code>servername</code></em> Lookup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ChoosingTdsProtocol.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Install <span class="productname">FreeTDS</span></th><td width="20%" align="right"> <a accesskey="n" href="freetdsconf.html">Next</a></td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="name.lookup"></a><em class="replaceable"><code>servername</code></em> Lookup</h2></div></div></div><p><span class="productname">FreeTDS</span> converts the servername to an IP address by following the steps below, stopping when it succeeds. </p><div class="orderedlist"><p class="title"><strong>Name lookup sequence <a href="#ftn.idm1005" class="footnote" id="idm1005"><sup class="footnote">[6]</sup></a> </strong></p><ol class="orderedlist" type="1"><li class="listitem"><p>Find <em class="replaceable"><code>servername</code></em> in <code class="filename">freetds.conf</code>. If a section with that name exists, use the hostname, port, and TDS version specified therein.</p></li><li class="listitem"><p>Attempt to convert <em class="replaceable"><code>servername</code></em> to an IP address with <code class="function">inet_addr(3)</code>.</p></li><li class="listitem"><p>Request name-lookup from the operating system via <code class="function">gethostbyname(3)</code> or similar.</p></li></ol></div><p> If the TDS version and port are not read from <code class="filename">freetds.conf</code>, they are derived from the compiled-in defaults and overridden by applicable environment variables.</p><p>As you can see, if most of your servers use the same TDS version and answer to the default port, then you don't need to list them all in <code class="filename">freetds.conf</code>. You can simply compile in the right defaults — or set the <code class="envar">TDSPORT</code> and <code class="envar">TDSVER</code> environment variables — and rely on DNS for name resolution.</p><div class="footnotes"><br /><hr style="width:100; text-align:left;margin-left: 0" /><div id="ftn.idm1005" class="footnote"><p><a href="#idm1005" class="para"><sup class="para">[6] </sup></a>This description applies to <code class="systemitem">DB-Library</code> and <code class="systemitem">CT-Library</code>. ODBC lookup is different.</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ChoosingTdsProtocol.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="install.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="freetdsconf.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Choosing a <acronym class="acronym">TDS</acronym> protocol version </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> The <code class="filename">freetds.conf</code> file</td></tr></table></div></body></html>