<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML ><HEAD ><TITLE >What it does</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="FreeTDS User Guide" HREF="index.htm"><LINK REL="UP" TITLE="The interfaces File" HREF="interfacesfile.htm"><LINK REL="PREVIOUS" TITLE="Where it goes" HREF="interfaceslocation.htm"><LINK REL="NEXT" TITLE="What it looks like" HREF="interfacesformat.htm"><LINK REL="STYLESHEET" TYPE="text/css" HREF="userguide.css"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" ><SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > User Guide: A Guide to Installing, Configuring, and Running <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN ></TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="interfaceslocation.htm" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Appendix B. The <TT CLASS="FILENAME" >interfaces</TT > File</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="interfacesformat.htm" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="INTERFACESPURPOSE" >What it does</A ></H1 ><P >The <TT CLASS="FILENAME" >interfaces</TT > 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 <TT CLASS="FILENAME" >interfaces</TT >. 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" ><P ></P ><TABLE CLASS="TIP" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="../images/tip.gif" HSPACE="5" ALT="Tip"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><TABLE CLASS="SIDEBAR" BORDER="1" CELLPADDING="5" ><TR ><TD ><DIV CLASS="SIDEBAR" ><A NAME="AEN6698" ></A ><P ><B >How's that again?</B ></P ><P >The <TT CLASS="FILENAME" >interfaces</TT > file sometimes trips people up. It seems innocuous enough, but it's also a pretty good example of <SPAN CLASS="QUOTE" >"it's easy if you know how"</SPAN >. Keep in mind:</P ><P ></P ><UL ><LI STYLE="list-style-type: disc" ><P >The <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >servername</I ></SPAN > is the name of the database server. When a database client specifies the <SPAN CLASS="QUOTE" >"name of the server"</SPAN > to connect to, it's the <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >servername</I ></SPAN > that is used.</P ></LI ><LI STYLE="list-style-type: disc" ><P >The <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >host name</I ></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 <B CLASS="COMMAND" >ping</B > the machine name to see if you've got it right. After it uses the <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >servername</I ></SPAN > to look up the <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >host name</I ></SPAN >, <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > will do the same thing <B CLASS="COMMAND" >ping</B > does to get the IP address of the machine to connect to.</P ></LI ><LI STYLE="list-style-type: disc" ><P >Finally, the <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >port number</I ></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" ><I CLASS="EMPHASIS" >know</I ></SPAN > the port number, and that it's correctly entered in the <TT CLASS="FILENAME" >interfaces</TT > file.</P ></LI ></UL ></DIV ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="interfaceslocation.htm" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.htm" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="interfacesformat.htm" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Where it goes</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="interfacesfile.htm" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >What it looks like</TD ></TR ></TABLE ></DIV ></BODY ></HTML >