-1

This is my output from cat /etc/resolve.conf

How can I just show the all nameservers ?

 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
nameserver 192.287.53.7
nameserver 127.0.0.53
Dominique
  • 16,450
  • 15
  • 56
  • 112
Zeroday
  • 27
  • 6
  • You tagged your question as `regex`. So you do know what you need. Have you searched for solutions? – nino Apr 26 '21 at 12:46

1 Answers1

0

That's easy:

grep -i "nameserver" /etc/resolve.conf

I added "-i" as you never know somebody starts writing with capitals.

Dominique
  • 16,450
  • 15
  • 56
  • 112