How to determine the IP addresses of all used DNS servers?
Through the terminal and through the shell file
The operating system uses the dns servers listed in the /etc/resolv.conf file as format strings:
nameserver ip-адрес You can view the entire contents of this file, for example, with the command:
$ cat /etc/resolv.conf Only lines beginning with the nameserver (usually not more than three) can be nameserver , for example, as follows:
$ grep ^nameserver /etc/resolv.conf you can display only ip-addresses from such lines, for example, like this:
$ sed -n 's/^nameserver\s\+//p' /etc/resolv.conf Source: https://ru.stackoverflow.com/questions/536406/
All Articles
/etc/resolv.conf- aleksandr barakin