yazz.com Asked: 2011-06-09 02:50:33 +0800 CST2011-06-09 02:50:33 +0800 CST 2011-06-09 02:50:33 +0800 CST In Ubuntu how can I find out the DNS servers used from the command line? 772 I need to know the addresses and ports of the Ubuntu DNS servers. How can I do this from the command line? linux domain-name-system 4 Answers Voted Best Answer Tom Shaw 2011-06-09T02:52:29+08:002011-06-09T02:52:29+08:00 Command-line: $ cat /etc/resolv.conf DNS servers listen by convention on port 53 TCP or UDP; UDP is used for most requests. Vladimir 2012-09-26T23:10:07+08:002012-09-26T23:10:07+08:00 Command-Line: nm-tool | grep DNS plaix 2011-06-09T02:58:12+08:002011-06-09T02:58:12+08:00 If you mean your local dns servers: cat /etc/resolv.conf and for information as to what port a general service runs on you can grep /etc/services for dns If you mean the ubuntu DNS servers for the domain just use nslookup Nico Stöckigt 2016-12-09T03:17:01+08:002016-12-09T03:17:01+08:00 Nowadays the following would help more, due to nm-tool is often missed: nmcli dev show | grep DNS
Command-line:
$ cat /etc/resolv.conf
DNS servers listen by convention on port 53 TCP or UDP; UDP is used for most requests.
Command-Line:
If you mean your local dns servers:
and for information as to what port a general service runs on you can grep /etc/services for dns
If you mean the ubuntu DNS servers for the domain just use nslookup
Nowadays the following would help more, due to nm-tool is often missed: