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


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

Default DNS lookup command?

Started byReiner Buehl <reiner.buehl@gmail.com>
First post2023-10-21 17:40 +0200
Last post2023-10-21 18:10 +0200
Articles 13 — 7 participants

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


Contents

  Default DNS lookup command? Reiner Buehl <reiner.buehl@gmail.com> - 2023-10-21 17:40 +0200
    Re: Default DNS lookup command? David Wright <deblis@lionunicorn.co.uk> - 2023-10-21 18:00 +0200
      Re: Default DNS lookup command? reiner.buehl@gmail.com - 2023-10-21 22:10 +0200
      Re: Default DNS lookup command? Max Nikulin <manikulin@gmail.com> - 2023-10-22 06:10 +0200
        Re: Default DNS lookup command? David Wright <deblis@lionunicorn.co.uk> - 2023-10-23 16:00 +0200
          Re: Default DNS lookup command? Max Nikulin <manikulin@gmail.com> - 2023-10-23 19:00 +0200
    Re: Default DNS lookup command? Greg Wooledge <greg@wooledge.org> - 2023-10-21 18:00 +0200
      Re: Default DNS lookup command? Richard Hector <richard@walnut.gen.nz> - 2023-10-22 13:50 +0200
        Re: Default DNS lookup command? Max Nikulin <manikulin@gmail.com> - 2023-10-23 19:10 +0200
          Re: Default DNS lookup command? Richard Hector <richard@walnut.gen.nz> - 2023-10-30 08:10 +0100
            Re: Default DNS lookup command? Max Nikulin <manikulin@gmail.com> - 2023-10-31 04:30 +0100
              Re: Default DNS lookup command? Richard Hector <richard@walnut.gen.nz> - 2023-11-12 20:30 +0100
    Re: Default DNS lookup command? Juri Grabowski <debian@jugra.de> - 2023-10-21 18:10 +0200

#262468 — Default DNS lookup command?

FromReiner Buehl <reiner.buehl@gmail.com>
Date2023-10-21 17:40 +0200
SubjectDefault DNS lookup command?
Message-ID<HrmeZ-hrvU-13@gated-at.bofh.it>
Hi all,

is there a DNS lookup command that is installed by default on any Debian 
Bullseye or Bookworm install? Something that doesn't require as much 
dependencies as bind9-utils (which provides dig and nslookup) or bind9-host?

Best regards,

Reiner

[toc] | [next] | [standalone]


#262469

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2023-10-21 18:00 +0200
Message-ID<Hrmyl-hrCJ-1@gated-at.bofh.it>
In reply to#262468
On Sat 21 Oct 2023 at 17:35:21 (+0200), Reiner Buehl wrote:
> is there a DNS lookup command that is installed by default on any
> Debian Bullseye or Bookworm install? Something that doesn't require as
> much dependencies as bind9-utils (which provides dig and nslookup) or
> bind9-host?

nslookup is in busybox. Type:

$ busybox nslookup
$ busybox nslookup debian.org

Cheers,
David.

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


#262493

Fromreiner.buehl@gmail.com
Date2023-10-21 22:10 +0200
Message-ID<Hrqsh-hufT-5@gated-at.bofh.it>
In reply to#262469
Perfect! Then I just need to add an alias to my profile and can use nslookup :-)

On 21.10.23 17:58, David Wright <deblis@lionunicorn.co.uk> wrote:
> On Sat 21 Oct 2023 at 17:35:21 (+0200), Reiner Buehl wrote:
> > is there a DNS lookup command that is installed by default on any
> > Debian Bullseye or Bookworm install? Something that doesn't require as
> > much dependencies as bind9-utils (which provides dig and nslookup) or
> > bind9-host?
> 
> nslookup is in busybox. Type:
> 
> $ busybox nslookup
> $ busybox nslookup debian.org
> 
> Cheers,
> David.
> 
> 

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


#262505

FromMax Nikulin <manikulin@gmail.com>
Date2023-10-22 06:10 +0200
Message-ID<HrxWN-hyZk-1@gated-at.bofh.it>
In reply to#262469
On 21/10/2023 22:58, David Wright wrote:
> On Sat 21 Oct 2023 at 17:35:21 (+0200), Reiner Buehl wrote:
>> is there a DNS lookup command that is installed by default on any
>> Debian Bullseye or Bookworm install?
> 
> nslookup is in busybox.

busybox is an optional package, so it may be absent. "getent hosts" from 
Greg's message is better in this sense. If systemd-resolved is 
configured on a particular instance then

     resolvectl query debian.org

may be an option.

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


#262600

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2023-10-23 16:00 +0200
Message-ID<Hs3Dj-hUG-9@gated-at.bofh.it>
In reply to#262505
On Sun 22 Oct 2023 at 11:07:05 (+0700), Max Nikulin wrote:
> On 21/10/2023 22:58, David Wright wrote:
> > On Sat 21 Oct 2023 at 17:35:21 (+0200), Reiner Buehl wrote:
> > > is there a DNS lookup command that is installed by default on any
> > > Debian Bullseye or Bookworm install?
> > 
> > nslookup is in busybox.
> 
> busybox is an optional package, so it may be absent. "getent hosts"
> from Greg's message is better in this sense. If systemd-resolved is
> configured on a particular instance then
> 
>     resolvectl query debian.org
> 
> may be an option.

AFAICT, if you don't have busybox installed, then I think it's likely
that you removed it yourself. The d-i initrd has busybox already installed,
and most people will see something like this in its log:

  # head -n2 /var/log/installer/syslog
  Jul 26 19:17:07 syslogd started: BusyBox v1.35.0
  Jul 26 19:17:07 kernel: klogd started: BusyBox v1.35.0 (Debian 1:1.35.0-4+b3)
  #

If the following file is still available (the one with the highest
generation number), you can see that busybox is typically the third
package to be installed by APT. (If the file has been rotated away,
just search for "busybox" in the file above.)

  # zcat /var/log/apt/history.log.2.gz | head

  Start-Date: 2023-07-26  19:30:49
  Commandline: apt-get -o APT::Status-Fd=4 -o APT::Keep-Fds::=5 -o APT::Keep-Fds::=6 -q -y --no-remove install locales
  Install: locales:i386 (2.36-9), libc-l10n:i386 (2.36-9, automatic)
  End-Date: 2023-07-26  19:30:56

  Start-Date: 2023-07-26  14:31:14
  Commandline: apt-get -o APT::Status-Fd=4 -o APT::Keep-Fds::=5 -o APT::Keep-Fds::=6 -q -y --no-remove install busybox
  Install: busybox:i386 (1:1.35.0-4+b3)
  End-Date: 2023-07-26  14:31:16
  # 

I suppose preseed experts might be able to prevent that from
happening, though to what purpose, IDK.

I can only assume that its Priority is set to Optional so that
it's easily removable if not required.

I don't see many reasons that systemd-resolved would get installed
unless you specifically asked for it, so I'd hardly call it
"installed by default".

Cheers,
David.

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


#262617

FromMax Nikulin <manikulin@gmail.com>
Date2023-10-23 19:00 +0200
Message-ID<Hs6rv-jWz-1@gated-at.bofh.it>
In reply to#262600
On 23/10/2023 20:52, David Wright wrote:
> AFAICT, if you don't have busybox installed, then I think it's likely 
> that you removed it yourself.

Or it is a LXC container installed using the "download" template. It 
uses systemd-networkd and systemd-resolved. I have never tried qemu with 
kernel and initrd loaded from host, so related tools are not necessary 
inside VM.

So for original requirement "on any Debian Bullseye or Bookworm install" 
I would not neglect resolvectl when systemd-resolved is active.

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


#262470

FromGreg Wooledge <greg@wooledge.org>
Date2023-10-21 18:00 +0200
Message-ID<Hrmym-hrCJ-7@gated-at.bofh.it>
In reply to#262468
On Sat, Oct 21, 2023 at 05:35:21PM +0200, Reiner Buehl wrote:
> is there a DNS lookup command that is installed by default on any Debian

getent hosts NAME
getent ahostsv4 NAME

That said, you get much finer control from dedicated tools.

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


#262516

FromRichard Hector <richard@walnut.gen.nz>
Date2023-10-22 13:50 +0200
Message-ID<HrF7X-2vN-1@gated-at.bofh.it>
In reply to#262470
On 22/10/23 04:56, Greg Wooledge wrote:
> On Sat, Oct 21, 2023 at 05:35:21PM +0200, Reiner Buehl wrote:
>> is there a DNS lookup command that is installed by default on any Debian
> 
> getent hosts NAME
> getent ahostsv4 NAME
> 
> That said, you get much finer control from dedicated tools.
> 

That is a useful tool I should remember.

But not strictly a DNS lookup tool:

richard@zircon:~$ getent hosts zircon
127.0.1.1       zircon.lan.walnut.gen.nz zircon

That's from my /etc/hosts file, and overrides DNS. I didn't see an 
option in the manpage to ignore /etc/hosts.

I haven't found a way to get just DNS results, without pulling in extra 
software.

Richard

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


#262618

FromMax Nikulin <manikulin@gmail.com>
Date2023-10-23 19:10 +0200
Message-ID<Hs6Bc-kfZ-9@gated-at.bofh.it>
In reply to#262516
On 22/10/2023 18:39, Richard Hector wrote:
> But not strictly a DNS lookup tool:
> 
> richard@zircon:~$ getent hosts zircon
> 127.0.1.1       zircon.lan.walnut.gen.nz zircon
> 
> That's from my /etc/hosts file, and overrides DNS. I didn't see an 
> option in the manpage to ignore /etc/hosts.

getent -s dns hosts zircon

However /etc/resolv.conf may point to local systemd-resolved server or 
to dnsmasq started by NetworkManager and they read /etc/hosts by default.

> I haven't found a way to get just DNS results, without pulling in extra 
> software.

Usual task for application is to resolve hostname and enough methods 
besides DNS may be used: multicast DNS, LLMNR, etc. If you need a debug 
tool then you should install it. On the other hand it is desperate when 
a feature is implemented, but not exposed to users.

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


#262881

FromRichard Hector <richard@walnut.gen.nz>
Date2023-10-30 08:10 +0100
Message-ID<Huuzn-1Qsz-9@gated-at.bofh.it>
In reply to#262618
On 24/10/23 06:01, Max Nikulin wrote:
> On 22/10/2023 18:39, Richard Hector wrote:
>> But not strictly a DNS lookup tool:
>>
>> richard@zircon:~$ getent hosts zircon
>> 127.0.1.1       zircon.lan.walnut.gen.nz zircon
>>
>> That's from my /etc/hosts file, and overrides DNS. I didn't see an 
>> option in the manpage to ignore /etc/hosts.
> 
> getent -s dns hosts zircon
> 
> However /etc/resolv.conf may point to local systemd-resolved server or 
> to dnsmasq started by NetworkManager and they read /etc/hosts by default.

Ah, thanks. But I don't feel too bad about not finding that ... 
'service' is not defined in that file, 'dns' doesn't occur, and 
searching for 'hosts' doesn't give anything useful either. I guess 
reading nsswitch.conf(5) is required.

Thanks,
Richard

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


#262948

FromMax Nikulin <manikulin@gmail.com>
Date2023-10-31 04:30 +0100
Message-ID<HuNC2-21Xm-3@gated-at.bofh.it>
In reply to#262881
On 30/10/2023 14:03, Richard Hector wrote:
> On 24/10/23 06:01, Max Nikulin wrote:
>> getent -s dns hosts zircon
>>
> Ah, thanks. But I don't feel too bad about not finding that ... 
> 'service' is not defined in that file, 'dns' doesn't occur, and 
> searching for 'hosts' doesn't give anything useful either. I guess 
> reading nsswitch.conf(5) is required.

Do you mean that "hosts" entry in your /etc/nsswitch.conf lacks "dns"? 
Even systemd nss plugins recommend to keep it as a fallback. If you get 
no results then your resolver or DNS server may not be configured to 
resolve single-label names. Try some full name

     getent -s dns ahosts debian.org

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


#263445

FromRichard Hector <richard@walnut.gen.nz>
Date2023-11-12 20:30 +0100
Message-ID<HzojD-4X1p-1@gated-at.bofh.it>
In reply to#262948
On 31/10/23 16:27, Max Nikulin wrote:
> On 30/10/2023 14:03, Richard Hector wrote:
>> On 24/10/23 06:01, Max Nikulin wrote:
>>> getent -s dns hosts zircon
>>>
>> Ah, thanks. But I don't feel too bad about not finding that ... 
>> 'service' is not defined in that file, 'dns' doesn't occur, and 
>> searching for 'hosts' doesn't give anything useful either. I guess 
>> reading nsswitch.conf(5) is required.
> 
> Do you mean that "hosts" entry in your /etc/nsswitch.conf lacks "dns"? 
> Even systemd nss plugins recommend to keep it as a fallback. If you get 
> no results then your resolver or DNS server may not be configured to 
> resolve single-label names. Try some full name
> 
>      getent -s dns ahosts debian.org

Sorry for the confusion (and delay) - I think I was referring to the 
getent man page, rather than the config file.

Richard

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


#262471

FromJuri Grabowski <debian@jugra.de>
Date2023-10-21 18:10 +0200
Message-ID<HrmI1-hrVD-23@gated-at.bofh.it>
In reply to#262468
Hello,

it's not really answer to your question, but for simple things like
IP-Addresses you can use getent ahosts, getent hosts or ping directly.

Best Regards,
Juri Grabowski

[toc] | [prev] | [standalone]


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


csiph-web