Cannot resolve pi hostname

Please follow the below template, it will help us to help you!

My Pi's username is 'pi', it's IP address is 10.0.0.6.

Expected Behaviour:

should resolve automatically:

ssh pi@pi

Actual Behaviour:

ssh pi@pi

results in:

ssh: Could not resolve hostname pi: nodename nor servname provided, or not known

Debug Token:

5n3qdsrukm

Yes, that works.

How can I rename "pi.hole" to "pi"?

You have the correct mapping already in /etc/pihole/local.list. What is the output of this command?

nslookup pi 10.0.0.6

Sorry for the late reply.
It's:

root@pi:/home/pi# nslookup pi 10.0.0.6
Server: 10.0.0.6
Address: 10.0.0.6#53

Name: pi
Address: 10.0.0.6

Also, the output of /etc/pihole/local.list:

10.0.0.6 pi
10.0.0.6 pi.hole

What is the output of that nslookup command on the machine that was having the issue?

It's:

pi@pi:~ $ nslookup pi 10.0.0.6
Server: 10.0.0.6
Address: 10.0.0.6#53

Name: pi
Address: 10.0.0.6

We need the output out of the machine you are trying to connect from. Not from the pi itself, please.

Right.

MacBook-Pro:~ Agneev$ nslookup pi 10.0.0.6
Server: 10.0.0.6
Address: 10.0.0.6#53

Name: pi
Address: 10.0.0.6

If I traceroute "pi":

MacBook-Pro:~ Agneev$ traceroute pi
traceroute: unknown host pi

But if I traceroute to "pi.hole":

MacBook-Pro:~ Agneev$ traceroute pi.hole
traceroute to pi.hole (10.0.0.6), 64 hops max, 52 byte packets
1 pi (10.0.0.6) 2.700 ms 2.702 ms 3.962 ms

Notice how pi.hole points to pi.

Check that you are only using Pi-hole as your DNS server, and clear the DNS cache. Also run this on the MacBook: nslookup pi

In my router's web UI:

My Router IP is 10.0.0.1.

MacBook-Pro:~ Agneev$ nslookup pi
Server: 10.0.0.1
Address: 10.0.0.1#53

Name: pi
Address: 10.0.0.6

Also how do I clear DNS cache?
Is it the equivalent of "Flush logs"? If so, I have already done it.

Google "Mac flush DNS cache"

sudo killall -HUP mDNSResponder

Done.

The DNS servers are returning the right information, but it seems that your MacBook is not doing something right. Do you see queries in the Query Log (or pihole -t) when you run the traceroute or try to SSH?

On my other computer:

Does that one also properly resolve via nslookup pi? Try ssh -vvv pi@pi

From your Mac, what is the output of

scutil --dns

This command shows the true order of the nameserver's your Mac is using.

nslookup pi:

C:\Users\agnee>nslookup pi
Server: router.asus.com
Address: 10.0.0.1

*** router.asus.com can't find pi: Non-existent domain

ssh -vvv pi@pi:

C:\Users\agnee>ssh -vvv pi@pi
OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
debug3: Failed to open file:C:\Users\agnee/.ssh/config error:2
debug3: Failed to open file:C:\ProgramData\ssh/ssh_config error:2
debug2: resolving "pi" port 22
ssh: Could not resolve hostname pi: The requested name is valid, but no data of the requested type was found.