I need to know the addresses and ports of the Ubuntu DNS servers. How can I do this from the command line?
DNS servers listen by convention on port 53 TCP or UDP; UDP is used for most requests.
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