F
F
fokin_nikolay19892022-02-25 14:03:55
linux
fokin_nikolay1989, 2022-02-25 14:03:55

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

2 answer(s)
A
Alexander Karabanov, 2022-02-25
@fokin_nikolay1989

catnot needed here.
Enoughgrep -P "^search" /etc/resolv.conf

V
vreitech, 2022-02-25
@fzfx

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 question

Ask a Question

731 491 924 answers to any question