Re: oninit fails using onsoctcp on linux
Posted in 2006
Hi Neil.
Try the following program, does it work fine with files dns in
/etc/nsswitch.conf ?
cat gethostbyname.c
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
main(int argc, const char **argv)
{
ulong_t addr;
struct hostent *hp;
char **p;
if (argc != 2) {
(void) printf("usage: %s hostname\\n", argv[0]);
exit (1);
}
hp = gethostbyname(argv[1]);
if (hp == NULL) {
(void) printf("host information for %s not found\\n", argv[1]);
exit (3);
}
for (p = hp->h_addr_list; *p != 0; p++) {
struct in_addr in;
char **q;
(void) memcpy(&in.s_addr, *p, sizeof (in.s_addr));
(void) printf("%s\\t%s", inet_ntoa(in), hp->h_name);
for (q = hp->h_aliases; *q != 0; q++)
(void) printf(" %s", *q);
(void) putchar('\\n');
}
}
cc gethostbyname.c -o gethostbyname -lnsl
Here is my result.
[tsutoo@urraco ~]% a.out www.google.co.jp
66.249.89.99 www.l.google.com www.google.co.jp www.google.com
66.249.89.104 www.l.google.com www.google.co.jp www.google.com
Regards.
--
Tsutomu Ogiwara from Tokyo Japan.
>From: "Neil Truby" <neil.truby@ardenta.com>
>To: informix-list@iiug.org
>Subject: Re: oninit fails using onsoctcp on linux
>Date: Fri, 1 Sep 2006 18:22:37 +0100
>
>"Keith Simmons" <smiley73@googlemail.com> wrote in message
>news:mailman.388.1157113153.20706.informix-list@iiug.org...
> > On 01/09/06, Neil Truby <neil.truby@ardenta.com> wrote:
> >> "Ruediger Maehl" <ruediger.maehl@web.de> wrote in message
> >> news:newscache$mv65zi$sen$1@www-neu.dzsh.de...
> >> > Hello Tsutomu,
> >> >
> >> >> Try the following.
> >> >>
> >> >> nslookup linux4
> >> >> Can you see correct ip address ?
> >> >>
> >> >> And make sure your /etc/resolv.conf and /etc/nsswitch.conf .
> >> >> In nsswitch.conf are specified
> >> >> hosts: files dns
> >> >> Then looking for /etc/hosts, then looking for DNS entry.
> >> >
> >> > Very good hint: when I use
> >> > hosts: files
> >> >
> >> > instead of
> >> > hosts: files dns
> >> >
> >> > then it works! Nevertheless, it is a bit strange.
> >> >
> >> > Thanks a lot,
> >>
> >> I've had this too. dbaccess works fine, but connectivty will not work
> >> unless I substitute the remote system's IP address for its hostname in
> >> sqlhosts, in which case it is fine. Has anyone else had this?
>Ruediger,
> >> did you raise a Tech Support call?
> >>
> >>
> >>
> >> _______________________________________________
> >> Informix-list mailing list
> >> Informix-list@iiug.org
> >> http://www.iiug.org/mailman/listinfo/informix-list
> >>
> >
> > Not really been following this thread, but just caught my eye. What is
> > your /etc/hosts entry. Try two names for each server:-
> > nn.nn.nn.nn server server.full.domain
> >
> > I've had issues where the full domain isn't specified and although you
> > can seem to get from one server to the other, you don't seem to be
> > able to get back !
> > Might be worth trying
> >
> > Keith
>
>I did try this, Keith, as it seemed good idea, although unfortunately the
>full-qualified name didn't fix it. Changing the /etc/nsswitch.conf file
>
>files dns
>to
>files
>
>*did* fix it, although I can't use that solution because it screws other
>aplications up. I'm pretty sure its a bug. I've a test server to build up
>a
>proper case when I get time.
>
>cheers
>Neil
>
>
>_______________________________________________
>Informix-list mailing list
>Informix-list@iiug.org
>http://www.iiug.org/mailman/listinfo/informix-list