From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,b308574f9841b3bf X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2004-04-23 18:45:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-proxy.abbnm.com!newsboy.eng.abbnm.com!not-for-mail From: peter@abbnm.com (Peter da Silva) Newsgroups: comp.unix.tru64 Subject: Re: gethostbyname returns only single IP address Date: Sat, 24 Apr 2004 01:32:44 +0000 (UTC) Organization: ABB Network Management Division Message-ID: References: <5d1678ff.0404220743.37a2d7e1@posting.google.com> <2as96c.7gf.ln@dadsys2.fuller.local> <5d1678ff.0404230504.2eb35ac4@posting.google.com> NNTP-Posting-Host: grendel.eng.abbnm.com X-Trace: jeeves.eng.abbnm.com 1082770364 19142 198.178.0.150 (24 Apr 2004 01:32:44 GMT) X-Complaints-To: usenet@jeeves.eng.abbnm.com NNTP-Posting-Date: Sat, 24 Apr 2004 01:32:44 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Originator: peter@abbnm.com (Peter da Silva) Xref: archiver1.google.com comp.unix.tru64:11383 In article <5d1678ff.0404230504.2eb35ac4@posting.google.com>, Calista wrote: > hostname is passed to this function. The name "gethostbyname" is deceptive, because in DNS hosts don't have name, interfaces do. Typically the interfaces on a multihomed host are given a name like: hostname.subnet1.dom.ain hostname.subnet2.dom.ain By convention, one of these interfaces is often considered the "primary" interface, and the machine is referred to by that name, but there's no such thing in DNS. > Now I print all IP addresses. It prints only one IP address although my > machine has multiple interfaces (two ip addresses). DNS doesn't know that the machine has multiple interfaces, though. You need to talk to the people who designed the DNS namespace to find out whether there's some name that's had both interfaces assigned to it (for example, for quick-and-dirty round-robin load-balancing). -- I've seen things you people can't imagine. Chimneysweeps on fire over the roofs of London. I've watched kite-strings glitter in the sun at Hyde Park Gate. All these things will be lost in time, like chalk-paintings in the rain. `-_-' Time for your nap. | Peter da Silva | Har du kramat din varg, idag? 'U`