I have a set of virtual machines that I have to configure for a school assignment. I configured a DHCP and a DNS server at my server machine. At the DHCP file the option-domain-name servers is pointing to the IP address of my DNS server and option-domain-name has the name of my 'aulas' domain.

The thing is...I have another machine on my network with two interfaces. One of them is configured by my school DHCP server and the other interface is configured by my DHCP server (which works fine). For some reason when I make DNS requests with dig, the DNS query goes to the school DNS server, which (of course) will not know this 'aulas' domain and will return no answers. I'll put the link to my conf files here.

I know that if I edit the client file /etc/resolv.conf and place my nameserver first it will solve the query. But if the two interfaces are both up and running the file will automatically be updated and will look like this:

nameserver 192.168.x.x
search students.x.x.x.x aulas.asr

Here, the query goes to the first nameserver (school DNS) and returns no answers without even trying the second nameserver. If I remove the first nameserver it works like a charm for my aulas.asr domain. Do I need to make some sort of routing to use both interfaces at the same time? If so, how can I do it?

  • your PC is using the NIC that connects to your school as the default interface. What happens when you disable it and then try again? – xR34P3Rx Dec 26 '16 at 18:11
  • what you can also do is modify your ip address settings on the school NIC and manually set it to use your VM's IP. – xR34P3Rx Dec 26 '16 at 18:12

If the DNS query positively determined that the name doesn't exist (from its point of view), that's still a success – and the resolver has no reason to keep retrying other servers. That only happens if there's no response at all (timeout) or if the server refuses the query outright.

The OS's built-in stub resolver only supports a single list of nameservers for everything – if you need per-domain routing, you'll need additional software: Unbound; dnsmasq; pdnsd; or systemd-resolved.

Example Unbound configuration:

# /etc/resolv.conf
# /etc/unbound/unbound.conf
    ...all the default stuff...

    name: "aulas.asr"

    name: "."
    forward-addr: 192.168.x.x

These settings can be updated live using unbound-control as well.

If the OS has "resolvconf" or "openresolv" installed, it can automatically generate configurations for Unbound/pdnsd/dnsmasq; see the resolvconf.conf manual.

NetworkManager can automatically start dnsmasq or Unbound, with per-connection DNS servers obtained from DHCP; see dns= in the NetworkManager.conf manual.

  • I get No manual entry for resolvconf.conf. I want to know how to make unbound work with resolvconf. unbound is installed, unbound.conf is edited properly, and I restarted the unbound service but it's not working. I even tried /etc/NetworkManager/NetworkManager.conf to change dns=unbound but still nothing. My original question is this: superuser.com/questions/1477850/… Thanks very much :) – Shayan Sep 1 '19 at 21:18
  • 1
    Do you have openresolv or Debian's resolvconf installed? – user1686 Sep 2 '19 at 5:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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