Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #255570 > unrolled thread

besides ping/nslookup, any other tools to resolve a hostname?

Started byKen Young <ken@highwinds.cloud>
First post2023-03-04 02:00 +0100
Last post2023-03-04 10:40 +0100
Articles 6 — 5 participants

Back to article view | Back to linux.debian.user


Contents

  besides ping/nslookup, any other tools to resolve a hostname? Ken Young <ken@highwinds.cloud> - 2023-03-04 02:00 +0100
    Re: besides ping/nslookup, any other tools to resolve a hostname? Greg Wooledge <greg@wooledge.org> - 2023-03-04 02:30 +0100
      Re: besides ping/nslookup, any other tools to resolve a hostname? Nicolas George <george@nsup.org> - 2023-03-04 10:40 +0100
    Re: besides ping/nslookup, any other tools to resolve a hostname? Max Nikulin <manikulin@gmail.com> - 2023-03-04 03:10 +0100
    Re: besides ping/nslookup, any other tools to resolve a hostname? Rodrigo Cunha <rodrigo.root.rj@gmail.com> - 2023-03-04 06:20 +0100
      Re: besides ping/nslookup, any other tools to resolve a hostname? Ken Young <ken@highwinds.cloud> - 2023-03-04 10:40 +0100

#255570 — besides ping/nslookup, any other tools to resolve a hostname?

FromKen Young <ken@highwinds.cloud>
Date2023-03-04 02:00 +0100
Subjectbesides ping/nslookup, any other tools to resolve a hostname?
Message-ID<G5opH-9TB4-1@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hello,

I have bitnami/mysql container (debian OS) running on kubernetes.
This container seems too restricted for system software, these following
commands are removed:

sudo (so I can't su to root for apt)
ping
dig
nslookup
net-tools

Do you know any other way to resolve a hostname by manual  on this
container?

Thanks
Ken

[toc] | [next] | [standalone]


#255571

FromGreg Wooledge <greg@wooledge.org>
Date2023-03-04 02:30 +0100
Message-ID<G5oSJ-9TZy-3@gated-at.bofh.it>
In reply to#255570
On Sat, Mar 04, 2023 at 08:53:39AM +0800, Ken Young wrote:
> ping
> dig
> nslookup
> net-tools
> 
> Do you know any other way to resolve a hostname by manual  on this
> container?

Dedicated lookup tools:

getent hosts
host
dnsqr

Utilities that resolve hostnames as a side effect of what they are:

ssh
scp
sftp
telnet
ftp
wget
curl
lynx (et al.)

[toc] | [prev] | [next] | [standalone]


#255579

FromNicolas George <george@nsup.org>
Date2023-03-04 10:40 +0100
Message-ID<G5wwV-9ZkD-1@gated-at.bofh.it>
In reply to#255571

[Multipart message — attachments visible in raw view] — view raw

Greg Wooledge (12023-03-03):
> Dedicated lookup tools:
> 
> getent hosts
> host
> dnsqr

It is important to know that host and dnsqr do actual DNS requests, and
therefore ignore local configuration about other means of resolving
hosts, including /etc/hosts.

getent hosts is the dedicated command, the one that matches directly the
libc API that is used by most applications.

Regards,

-- 
  Nicolas George

[toc] | [prev] | [next] | [standalone]


#255572

FromMax Nikulin <manikulin@gmail.com>
Date2023-03-04 03:10 +0100
Message-ID<G5pvr-9Urp-1@gated-at.bofh.it>
In reply to#255570
On 04/03/2023 07:53, Ken Young wrote:
> Do you know any other way to resolve a hostname by manual  on this 
> container?

systemd-resolve

However I am unsure concerning k8s containers. Some interpreters:

python3 -c 'import socket as s, sys; 
print(s.gethostbyname(sys.argv[1]))' debian.net

[toc] | [prev] | [next] | [standalone]


#255574

FromRodrigo Cunha <rodrigo.root.rj@gmail.com>
Date2023-03-04 06:20 +0100
Message-ID<G5stj-9Ws8-1@gated-at.bofh.it>
In reply to#255570

[Multipart message — attachments visible in raw view] — view raw

>
> I have bitnami/mysql container (debian OS) running on kubernetes.
> This container seems too restricted for system software, these following
> commands are removed:
>
> sudo (so I can't su to root for apt)
> ping
> dig
> nslookup
> net-tools
>
It is a good practice to build small images for pods without commands for
the network. To solve this problem, you can do that:
Create a pod in the same network with net tools.
Or
1 .rebuild a new docker image with another version, with net-tools.
2. then change the current pod with edit in deployment.



On Fri, Mar 3, 2023 at 9:59 PM Ken Young <ken@highwinds.cloud> wrote:

> Hello,
>
> I have bitnami/mysql container (debian OS) running on kubernetes.
> This container seems too restricted for system software, these following
> commands are removed:
>
> sudo (so I can't su to root for apt)
> ping
> dig
> nslookup
> net-tools
>
> Do you know any other way to resolve a hostname by manual  on this
> container?
>
> Thanks
> Ken
>


-- 
Atenciosamente,
Rodrigo da Silva Cunha
São Gonçalo, RJ - Brasil

[toc] | [prev] | [next] | [standalone]


#255580

FromKen Young <ken@highwinds.cloud>
Date2023-03-04 10:40 +0100
Message-ID<G5wwV-9ZkD-5@gated-at.bofh.it>
In reply to#255574

[Multipart message — attachments visible in raw view] — view raw

Hi,

I just launched an ubuntu container in that namespace and installed
dnsutils/iputils-ping to resolve the hostname issue.

Thank you.


On Sat, Mar 4, 2023 at 1:11 PM Rodrigo Cunha <rodrigo.root.rj@gmail.com>
wrote:

> I have bitnami/mysql container (debian OS) running on kubernetes.
>> This container seems too restricted for system software, these following
>> commands are removed:
>>
>> sudo (so I can't su to root for apt)
>> ping
>> dig
>> nslookup
>> net-tools
>>
> It is a good practice to build small images for pods without commands for
> the network. To solve this problem, you can do that:
> Create a pod in the same network with net tools.
> Or
> 1 .rebuild a new docker image with another version, with net-tools.
> 2. then change the current pod with edit in deployment.
>
>
>
> On Fri, Mar 3, 2023 at 9:59 PM Ken Young <ken@highwinds.cloud> wrote:
>
>> Hello,
>>
>> I have bitnami/mysql container (debian OS) running on kubernetes.
>> This container seems too restricted for system software, these following
>> commands are removed:
>>
>> sudo (so I can't su to root for apt)
>> ping
>> dig
>> nslookup
>> net-tools
>>
>> Do you know any other way to resolve a hostname by manual  on this
>> container?
>>
>> Thanks
>> Ken
>>
>
>
> --
> Atenciosamente,
> Rodrigo da Silva Cunha
> São Gonçalo, RJ - Brasil
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web