nslookup : can't resolve any domain

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
pablo213
DD-WRT Novice


Joined: 02 Jun 2020
Posts: 8

PostPosted: Wed Aug 05, 2020 19:04    Post subject: nslookup : can't resolve any domain Reply with quote
Hi,

I'd like to make a script to change DNS conf if my local DNS (pi hole) fails.

To verify that my DNS works I'd like to use nslookup on my router but it just fails everytime.
For information, my DNS config and everything work just fine on my whole network.

On DD-WRT via SSH I get:
Code:
$ nslookup google.com 8.8.8.8

Server: 8.8.8.8
Address 1: 8.8.8.8   

nslookup: can't resolve 'google.com'


Code:
$ nslookup google.com 10.0.0.50 # My Pi Hole IP

Server: 10.0.0.50
Address 1: 10.0.0.50 Raspberry-Pi   

nslookup: can't resolve 'google.com'


Doesn't work with other domains than google either, and I basically tried every IP to resolve it (10.0.0.0, 10.0.0.1, 198.168.0.1, 198.168.0.254, 127.0.0.1, etc...).

My config is :

Code:
$ cat /tmp/resolv.conf

nameserver 10.0.0.1

(which is my router IP, so DD-WRT current local IP. Tried to replace it with "nameserver 10.0.0.50", no luck)

Code:
$ cat /tmp/hosts

127.0.0.1 localhost
10.0.0.1 DD-WRT
10.0.0.50 Raspberry-Pi

# + other devices on my network


But I guess nslookup should work regardless my DNS config as I give it a DNS IP.
Also, no surprise, I can ping 8.8.8.8 but I can't ping google.com.

Maybe it's a network interface related problem ? I can only guess right now, it's out of my domain of expertise :p

Do you have any clue ?
Any help would be greatly appreciated Very Happy


Last edited by pablo213 on Fri Aug 07, 2020 12:04; edited 1 time in total
Sponsor
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Aug 06, 2020 1:02    Post subject: Reply with quote
Should you be including the protocol (http/https) in your nslookup? I think not. It's not relevant.
_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1443
Location: Appalachian mountains, USA

PostPosted: Thu Aug 06, 2020 14:32    Post subject: Reply with quote
Indeed:

# nslookup google.com 9.9.9.9
Server: 9.9.9.9
Address 1: 9.9.9.9 dns9.quad9.net

Name: google.com
Address 1: 172.217.9.14 dfw28s02-in-f14.1e100.net
Address 2: 2607:f8b0:4000:812::200e dfw28s02-in-x0e.1e100.net

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
pablo213
DD-WRT Novice


Joined: 02 Jun 2020
Posts: 8

PostPosted: Fri Aug 07, 2020 12:03    Post subject: Reply with quote
Right, sorry I edited my first post.

nslookup google.com 9.9.9.9 does not resolve either.
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1404

PostPosted: Fri Aug 07, 2020 20:31    Post subject: Reply with quote
if you truely are doing everything correctly now. Then that means one of your settings is wrong for DNS. What have you changed/setup?

Does your pi-hole dns work?
pablo213
DD-WRT Novice


Joined: 02 Jun 2020
Posts: 8

PostPosted: Sat Aug 08, 2020 10:11    Post subject: Reply with quote
I've found out ! Smile

Yes everething was working regarding my Pi-Hole, on every devices connected to my router and even remote requests on port 53 was working. The only device where I wasn't able to nslookup (using my Pi-Hole DNS or any DNS) was my DD-WRT router.

The cause was : I unticked the box "Use DNSmasq for DNS" in the main settings page.
Didn't cause any trouble on my network but only localy on my router it seems. Now that the box is ticked everything works fine Wink
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14081
Location: Texas, USA

PostPosted: Sat Aug 08, 2020 11:49    Post subject: Reply with quote
You could've just specified your Pi-Hole to be used by the router for DNS.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
pablo213
DD-WRT Novice


Joined: 02 Jun 2020
Posts: 8

PostPosted: Sat Aug 08, 2020 11:58    Post subject: Re: nslookup : can't resolve any domain Reply with quote
That's what I was trying with :

pablo213 wrote:

Code:
$ nslookup google.com 10.0.0.50 # My Pi Hole IP

Server: 10.0.0.50
Address 1: 10.0.0.50 Raspberry-Pi   

nslookup: can't resolve 'google.com'


Didn't work, I don't know why.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14081
Location: Texas, USA

PostPosted: Sat Aug 08, 2020 12:20    Post subject: Reply with quote
Helps if you configure things correctly:

https://discourse.pi-hole.net/t/pi-hole-and-routers-with-third-party-firmware-dd-wrt-tomato-openwrt/18416

Part of the problem was the checkbox, not sure if the rest of your config was correct or not Twisted Evil

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
pablo213
DD-WRT Novice


Joined: 02 Jun 2020
Posts: 8

PostPosted: Sat Aug 08, 2020 12:28    Post subject: Reply with quote
I had configured DNSmasq correctly beforehand but I'm not sure why I had unticked the "Use DNSMasq for DNS" box.

But unlike the pi-hole tutorial my Local DNS and Static DNS 1 fields are filled with my pi-hole IP.
I guess that did the work for my network but not for my router.

Anyway if anybody have trouble resolving domain names on a DD-WRT router make sure DNSmasq is active Razz
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum