Been having some odd issues lately. Pi-hole also recently changed the nameserver to an IPV6 address which caused an issue where I could not update gravity, found the solution to that here but not sure what the cause was.
Updating in case someone is able to get to this thread in the next 48 hours. Will keep updating, I understand there are lots of help threads to get too.
$ man nslookup
[..]
DESCRIPTION
nslookup is a program to query Internet domain name servers.
nslookup has two modes: interactive and non-interactive. In‐
teractive mode allows the user to query name servers for in‐
formation about various hosts and domains or to print a list
of hosts in a domain. Non-interactive mode prints just the
name and requested information for a host or domain.
ARGUMENTS
Interactive mode is entered in the following cases:
a. when no arguments are given (the default name server is
used);
b. when the first argument is a hyphen (-) and the second ar‐
gument is the host name or Internet address of a name
server.
Non-interactive mode is used when the name or Internet ad‐
dress of the host to be looked up is given as the first argu‐
ment. The optional second argument specifies the host name or
address of a name server.
If do so, you should drop the nslookup part and only enter test.com instead eg:
When entering interactive mode like you did in the OP, you entered nslookup on the > prompt.
But nslookup is not a valid interactive command.
Check the man page with below one to check which are (the INTERACTIVE COMMANDS section):
man nslookup
What happened was that you instructed nslookup to lookup the nslookup domainname against DNS server test.com.
Similar as below non-interactively:
$ nslookup nslookup test.com
;; communications error to 3.18.255.247#53: timed out
;; communications error to 3.18.255.247#53: timed out
;; communications error to 3.18.255.247#53: timed out
;; communications error to 34.224.149.186#53: timed out
;; no servers could be reached
Or below:
$ dig nslookup @test.com
;; communications error to 3.18.255.247#53: timed out
;; communications error to 3.18.255.247#53: timed out
;; communications error to 3.18.255.247#53: timed out
;; communications error to 34.224.149.186#53: timed out
; <<>> DiG 9.18.24-1-Debian <<>> nslookup @test.com
;; global options: +cmd
;; no servers could be reached
There is no DNS server listening (ports 53 UDP/TCP) on the resolved IP 3.18.255.247:
$ sudo nmap -sS pi.hole
Starting Nmap 7.93 ( https://nmap.org ) at 2025-01-17 21:23 CET
Nmap scan report for pi.hole (10.0.0.2)
Host is up (0.0052s latency).
rDNS record for 10.0.0.2: ph5a.home.dehakkelaar.nl
Not shown: 997 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
53/tcp open domain
80/tcp open http
MAC Address: B8:27:EB:xx:xx:xx (Raspberry Pi Foundation)
Nmap done: 1 IP address (1 host up) scanned in 0.45 seconds
$ sudo nmap -sS 3.18.255.247
Starting Nmap 7.93 ( https://nmap.org ) at 2025-01-17 21:25 CET
Nmap scan report for ec2-3-18-255-247.us-east-2.compute.amazonaws.com (3.18.255.247)
Host is up (0.11s latency).
All 1000 scanned ports on ec2-3-18-255-247.us-east-2.compute.amazonaws.com (3.18.255.247) are in ignored states.
Not shown: 1000 filtered tcp ports (no-response)
Nmap done: 1 IP address (1 host up) scanned in 11.33 seconds
To get a better understanding what you can do with nslookup, I'd suggest to check out that man page!
Those man pages are a treasure of information: