• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

How to setup dns resolver in Ubunut 12 server ?

My first Precise Pangolin deployment.

I'm having issues with dns resolution not working - turns out /etc/resolv.conf is not anymore the place to manage this.

I tried to add “dns-nameservers”, “dns-search” and “dns-domain” entries in /etc/network/interfaces but they don't seem to work either (no server could be reached error, although I can ping those listed with dns-nameservers.

My interfaces files reads

auto eth0
iface eth0 inet static
dns-search mydomain.local

If I do a host xxx.domain.com it works - it's just that there is a config problem with default resolvers.

What am I missing ?
Alexandre Takacs
Alexandre Takacs
  • 4
1 Solution
can you please post the contents of your /etc/resolv.conf file?

should be something like

search mydomain.local

Open in new window

can you also post the output of the command 'dig'?
should be something like:

; <<>> DiG 9.8.1-P1 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55303
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 0

;.                              IN      NS

.                       2816    IN      NS      f.root-servers.net.
.                       2816    IN      NS      j.root-servers.net.
.                       2816    IN      NS      m.root-servers.net.
.                       2816    IN      NS      e.root-servers.net.
.                       2816    IN      NS      h.root-servers.net.
.                       2816    IN      NS      a.root-servers.net.
.                       2816    IN      NS      c.root-servers.net.
.                       2816    IN      NS      l.root-servers.net.
.                       2816    IN      NS      d.root-servers.net.
.                       2816    IN      NS      g.root-servers.net.
.                       2816    IN      NS      b.root-servers.net.
.                       2816    IN      NS      k.root-servers.net.
.                       2816    IN      NS      i.root-servers.net.

;; Query time: 3 msec
;; WHEN: Thu Aug 16 12:19:16 2012
;; MSG SIZE  rcvd: 228

Open in new window

Alexandre TakacsCTOAuthor Commented:
The  /etc/resolv.conf reads "#DO NOT EDIT THIS FILE" and has one entry "dns-search mydomain.local" (presumably carried over from the interfaces directives).

As for "dig" it times out with an error "no servers could be reached".
Wow - They changed the location of the resolvers on Ubuntu?
According to this file, you are right on the money on making changes to /etc/network/interfaces according to this link

Is your DNS server up?
Can you try putting on this file and see if DNS works first
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Alexandre TakacsCTOAuthor Commented:
Yes my DNS are working ok if I specify them in a "host" lookup. Just that somehow - despite my settings above - the system does not seem to know how to resolve by itself. Although a server it does not have BIND installed and don't really plan to.

As an aside what was the rationale behind removing support for /etc/resolv.conf ? I'm sure it's not just to annoy long time users... [Edited: ok I have followed some of the links above and better understand the change although not 100% convinced].
Alexandre TakacsCTOAuthor Commented:
I managed to have it working by creating /etc/resolvconf/resolv.conf.d/tail file and manually inserting "nameserver x.x.x.x". This is being carried over into the "dynamically assembled" resolv.conf and allows for successful dns resolution. Obviously not the intended behavior but at least I can get things moving now...
Alexandre TakacsCTOAuthor Commented:
Self solved

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now