Skip to Content.
Sympa Menu

freetds - Re: network unreachable with freetds

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: network unreachable with freetds
  • Date: Thu, 8 Aug 2002 16:44:35 -0400


> From: Casey Letzia [mailto:casey AT creditguard.org]
> Sent: August 8, 2002 3:07 PM

Casey,

> Thanks for your prompt reply. I misspoke about the remarking
> out the name servers in /etc/hosts. I did that in /etc/resolv.conf.

I'm glad to help.

ISTR other RH resolver problems, along the lines of the hosts/DNS contention
you seem to be experiencing. It may be something in the way FreeTDS uses
the name services, or just flakiness in the OS. Or 17 other things, 2 of
which I can think of.

> I was able to connect using the hostname/port parameters.

But "tsql -S servername" fails, eh?

> The error message did not include the correct ip address. It
> always has a random address from the multicast range.
> On our redhat 7.1 box the file that allegedly controls search
> order is /etc/host.conf. It says "order hosts,bind".

Let me recap to make sure I understand. With normal setup:

1. telnet works.
2. tsql -H host -p port, works.
3. tsql -S server, fails with random multicast address.
4. PHP fails, as #3.

>From those four data points, we know that name resolution works (1,2). We
can say conclusively from #3 that the problem lies in interpreting
freetds.conf or reading the "wrong" one. Which file was used is logged if
TDSDUMPCONFIG is defined (http://www.freetds.org/userguide/x305.htm#AEN369).


Without DNS, though, #3 and #4 work. Why? DNS should *never* be consulted,
because this hostname appears in /etc/hosts, and /etc/hosts.conf says to use
hosts before DNS. Unless, of course, the "wrong" file is being used to
lookup the servername, yielding the wrong hostname, yielding the wrong
address.

BTW, does the line in /etc/hosts have a domain name? It should look like
this:

10.1.2.3 servername.domain.com servername

where ".domain.com" matches what hostname(1) returns (unless they're in
different domains, of course). Some people don't include the domain name in
the hostname; that's a mistake.

You might want to run tsql -S under gdb, set breakpoint at
tds/threadsafe.c:81, which is where gethostbyname(3) is called. Take a look
at the contents of the returned pointer. It will contain the name and
address of the host FreeTDS will connect to. If the name is wrong,
something's up with freetds.conf (or $SYBASE/interfaces). If the ip is
wrong, something's awry in the resolver.

If you're not so enterprising, you might try just setting the ip address in
freetds.conf. That circumvents name resolution, of course, at the cost of
foregoing name resolution. ;)

> Thanks for not blowing me off for being some wanker who
> doesn't know jack about networking.....even though I am :-)

HTH. Your message was clear and polite, and no one knows everything. And I
never learned anything blowing someone off. :)

Regards,

--jkl


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that for certain accounts we do not accept
orders and/or instructions by e-mail, and for those accounts we will not be
responsible for carrying out such orders and/or instructions. Kindly refrain
from sending orders or instructions by e-mail unless you have confirmed that
we accept such communications for your account. Please also note that to
satisfy regulatory requirements we review the outgoing and incoming e-mail
correspondence of staff members serving certain functions.






Archive powered by MHonArc 2.6.24.

Top of Page