[erlang-bugs] : : : : inet_res:getbyname

Matthew O'Gorman mogorman@REDACTED
Tue Sep 11 01:23:14 CEST 2007


On my friends box that did not solve the problem, all queries there
just fail, however on is box I was also unable to use -name as it
crashed the shell, saying it couldn't get long name.

Mog
On 9/10/07, Raimo Niskanen <raimo+erlang-bugs@REDACTED> wrote:
> If you could test a solution for me it would be nice (Windows is a bit
> in the backwater here; we build and test but our personal build and
> test platform is Solaris8 as for now).
>
> Test the same solution I described below, but the file contents should be:
> ---------------cut
> {registry,win32}.
> ---------------cut
> That should load the data corresponding to /etc/hosts and /etc/resolv.conf.
> The /etc/hosts data will not be used (unless you have 'file' in the lookup
> order (that defaults to 'native' only)).
>
> This could (if it works fine) be something to always do on Windows
> to initialize inet_res.
>
>
>
> On Mon, Sep 10, 2007 at 03:14:56AM -0500, Matthew O'Gorman wrote:
> > any possible solutions for windows users? I ask as the reason I posted
> > in first place is my friend installed ejabberd for windows and didnt
> > work out of the box for him do to this issue.  I was able to get it
> > working for him with -name though, so he is fine now, I just imagine
> > its a common problem.
> > Anyways thanks for looking in to it and letting me know it will be
> > supported and maintained.
> >
> > Mog
> >
> > On 9/10/07, Raimo Niskanen <raimo+erlang-bugs@REDACTED> wrote:
> > > Well, it is deprecated for A and AAAA lookups since it was
> > > impossible to make it behave like the native resolver on all
> > > platforms. For DNS lookups where you really want just a DNS
> > > lookup it is still needed, so we can not remove it and
> > > have to fix bugs in it.
> > >
> > > In other words: it is and will be maintained.
> > >
> > > That it only works in conjunction with the -name option
> > > I also regard as a bug, but behaviour in this area has always
> > > been very sensitive to change, so improving this might
> > > break code for paying customers.
> > >
> > > I will try to investigate the possibility to always read
> > > /etc/resolv.conf on all Unixes to set up inet_res. That does
> > > not sound like a too dangerous change for R12, but I do not
> > > have the final word here...
> > >
> > > The workaround below does work, but that function is on the
> > > "possible to remove" list. Another more supported way of
> > > doing exactly the same thing is to create a file e.g
> > > "~/.inetrc" containing:
> > > ---------------cut
> > > {file,resolv,"/etc/resolv.conf"}.
> > > ---------------cut
> > > and then either set the environment variable
> > > ERL_INETRC="~/.inetrc"
> > > or, set the Erlang kernel application parameter "inetrc" to
> > > the same filename either on the command line like this:
> > > $ erl -kernel inetrc "\"~/.inetrc\""
> > > or in the Erlang start script (I have never done it).
> > >
> > >
> > >
> > > On Sat, Sep 08, 2007 at 11:41:37AM +0200, Mikael Magnusson wrote:
> > > > Matthew O'Gorman wrote:
> > > > > Exactly, I do want to do a dns query on the srv, currently the only
> > > > > way i know to do that is using inet_res, which is deprecated and
> > > > > broken for everything but -name, if there is to be a replacement or
> > > > > there is another way to make it work I would appreciate knowing it.
> > > > >
> > > > > Mog
> > > >
> > > > I'm able to use inet_res also on nodes with short names (-sname) if I
> > > > call inet_db:add_resolv:
> > > >
> > > >      inet_db:add_resolv("/etc/resolv.conf").
> > > >
> > > > Btw, why not always use long node names (-name)?
> > > >
> > > > Mikael
> > > > _______________________________________________
> > > > erlang-bugs mailing list
> > > > erlang-bugs@REDACTED
> > > > http://www.erlang.org/mailman/listinfo/erlang-bugs
> > >
> > > --
> > >
> > > / Raimo Niskanen, Erlang/OTP, Ericsson AB
> > > _______________________________________________
> > > erlang-bugs mailing list
> > > erlang-bugs@REDACTED
> > > http://www.erlang.org/mailman/listinfo/erlang-bugs
> > >
> > _______________________________________________
> > erlang-bugs mailing list
> > erlang-bugs@REDACTED
> > http://www.erlang.org/mailman/listinfo/erlang-bugs
>
> --
>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB
>



More information about the erlang-bugs mailing list