Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to know the addresses and ports of the Ubuntu DNS servers. How can I do this from the command line?

share|improve this question
up vote 7 down vote accepted

Command-line: $ cat /etc/resolv.conf

DNS servers listen by convention on port 53 TCP or UDP; UDP is used for most requests.

share|improve this answer


nm-tool | grep DNS
share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.