getaddrinfo failed - Name or service not known

Tom H tomh0665 at gmail.com
Mon Nov 18 21:06:40 UTC 2013


On Mon, Nov 18, 2013 at 6:06 PM, Unga <unga888 at yahoo.com> wrote:
>
> I'm using Ubuntu 13.10 on i386.
>
> I'm new to Ubuntu but an advance user in FreeBSD.
>
> I'm trying to run a service (aka daemon) on Ubuntu and getaddrinfo(3) fails with the following message: Name or service not known
>
> This service runs chrooted.
>
> I have only following in my chroot/etc directory:
> localtime  protocols  services
>
> The TCP service I want run is available in the chroot/etc/services.
>
> When this service run on FreeBSD, the devfs is mounted on chroot/dev but not on Ubuntu.
>
> In fact, how to mount the devfs on chroot/dev ?
>
> cat /etc/resolv.conf shows:
> nameserver 127.0.1.1
>
> Firefox can browse well. On command line ping and dig resolves to the server I try to connect.
>
> I don't understand why the getaddrinfo(3) still fail. On FreeBSD its works fine.

1) When you say that firefox/ping/dig function as expected, I assume
that you mean that they function outside of the chroot.

The reason that they function is that dnsmasq is running as a
forwarding dns server. I wouldn't expect them to be able to query
dnsmasq from within the chroot.

Does setting "nameserver 8.8.8.8" (or any other public dns server) in
the chroot allow your getaddrinfo daemon to work?

2) When you say "mount the devfs on chroot/dev" do you mean to
bind-mount "/dev" on "$chroot/dev"?




More information about the ubuntu-users mailing list