Ubuntu – How to change default dns server

dns

I am new to ubuntu. When I use the following command
nslookup askubuntu.com it gives following output:

Server: 127.0.0.1
Address: 127.0.0.1#53

Non-authoritative answer:
Name: askubuntu.com
Address: 198.252.206.24

My question is why it is showing my IP address as default DNS server. Does ubuntu contain any DNS service by default. How I can change the default DNS server.

Best Answer

I think network-manager uses dnsmasq as local DNS server. So that's why it is showing your localhost IP as DNS server.

To change that, look at How can I disable the DNS that Network Manager uses?

This local DNS server (dnsmasq) will use your router DNS server if you use dhcp or whatever DNS server is configured in the router (dhcp) configuration.

Related Question