I have set up my /etc/bind to set up the following:

dig @ +noall +answer SRV _my-sub._tcp.example.com

_my-sub._tcp.example.com. 300 IN SRV 0 0 12379 a0.example.com.
_my-sub._tcp.example.com. 300 IN SRV 0 0 22379 a1.example.com.
_my-sub._tcp.example.com. 300 IN SRV 0 0 32379 a2.example.com.

dig @ +noall +answer a0.example.com a1.example.com a2.example.com

a0.example.com. 300 IN  A
a1.example.com. 300 IN  A
a2.example.com. 300 IN  A

And now I want to edit my /etc/resolv.conf to get the same results without @ How do I overwrite resolv.conf to achieve this?


dig +noall +answer a0.example.com a1.example.com a2.example.com

Should return:

a0.example.com. 300 IN  A
a1.example.com. 300 IN  A
a2.example.com. 300 IN  A
  • What is the ubuntu version you use? You can add a record to resolv.conf but in newer ubuntu OS's it will be overwritten on reboot.
    – eranga
    Jan 13, 2016 at 10:55

2 Answers 2


You can either remove all nameserver references from your resolv.conf or you can add a specific


to your file. Note that if you add multiple nameserver entries they are tried in the order they are defined. Note also that the maximum is currently three.

You should probably read the documentation, resolv.conf(5).


Bear in mind that BIND (and the zone files and such in /etc/bind) acts as a directory of sorts: it lists the hosts that exist in example.com, what their IP addresses are, and that sort of thing.

/etc/resolv.conf, on the other hand, tells your machine where to look up information in DNS. Just because a machine is running a nameserver doesn't mean that it has to use it (there might be times when you don't want to use the same DNS data you provide to others).

So when you ask how to avoid having to use @, you're really asking, "How can I set as the default nameserver?". As Iain said, add nameserver to your /etc/resolv.conf.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .