Answer the question
In order to leave comments, you need to log in
How to get search directive out of resolv.conf?
Tell me how to remove the search directive from resolv.conf?
there is something other than cat /etc/resolv.conf | grep search
if I execute
nuclei dev show | grep DNS
it displays the directive from the file nameserver
, in fact I need to display the DNS names registered on linux
Answer the question
In order to leave comments, you need to log in
cat
not needed here.
Enoughgrep -P "^search" /etc/resolv.conf
The search directive from /etc/resolv.conf renders nicely with cat /etc/resolv.conf | grep search
. Of course, you can play around with the commands and get it output without grep or without cat, with awk or sed, but it doesn't make much sense, use cat with grep, that's enough. If the search directive is present in the /etc/resolv.conf file, then any valid command with grep, awk, sed, perl, etc. will display it, and if this directive is not in the mentioned file, then no command will display it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question