Score:1

Ping works but nslookup doesn't see resolv.conf domain search

in flag

My /etc/resolv.conf contains one search line that looks like this:

search a.local b.local c.local

The ping command works fine:

$ ping some-server
PING some-server.b.local (10.20.30.40) 56(84) bytes of data.
64 bytes from 10.20.30.40 (10.20.30.40): icmp_seq=1 ttl=58 time=47.8 ms

But the nslookup (or host) commands don't work without the FQDN:

$ nslookup some-server
;; Got SERVFAIL reply from 10.100.0.200, trying next server
;; Got SERVFAIL reply from 10.100.0.201, trying next server
Server:     127.0.0.53
Address:    127.0.0.53#53

** server can't find some-server: SERVFAIL

$ nslookup some-server.b.local
Server:     10.100.0.200
Address:    10.100.0.200#53

Non-authoritative answer:
Name:   some-server.b.local
Address: 10.20.30.40

How can I fix nslookup to work properly with my search domains?

Score:0
la flag

To make sure you have the correct dns setup try doing the following:

  sudo nano /etc/resolvconf/resolv.conf.d/base

then paste the following:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 8.8.8.8
nameserver 8.8.4.4

exit and save the file then

  sudo resolvconf -u   #updates the resolve file from the file we made above. 
  cat /etc/resolv.conf # prints the contents of the resolv file

it should show the text we saved there. After that try the nslookup that failed before, hopefully it works now.

Raffa avatar
jp flag
I doubt adding external DNS servers will help in resolving local network hostnames ... But adding the router's IP might.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.