3

At my workplace, our IT department manages a DNS server. My department works a lot with websites and to access staging servers we need to have certain domains map to those servers. Personally I just edit my hosts file, but our team is somewhat large and I can't go to every machine and edit their hosts file every single time.

So my solution is to have a simple DNS forwarding server. I want to use dnsmasq. I'll refer to the companies DNS domain as company.com and the domain I want to use for our local DNS as mydomain.com

Currently I have the DNS server running, and I'm using argonath as a subdomain of mydomain.com. There are two machine connected at the moment, one is a windows box called pc115 and the other is a linux workstation called mithrandir. My "sub dns" forwards any queries it can't answer to company.com's DNS, and that works nicely. The Linux workstation is working correctly (so for example, ping pc115 works).

However on the windows machine, I'm having trouble doing ping mithrandir. What it looks like is happening, is Windows automatically tacks on company.com to any queries. So my DNS gets mithrandir.company.com which it knows nothing about, and forwards that to the bigger DNS. Here's the relevant part of the dnsmasq logfile (172.17.14.19 is the company's DNS and 10.10.31.15 is mine):

May 12 15:07:52 dnsmasq[11970]: query[A] mithrandir.company.com from 10.10.31.15
May 12 15:07:52 dnsmasq[11970]: forwarded mithrandir.company.com to 172.17.14.19
May 12 15:07:52 dnsmasq[11970]: reply mithrandir.company.com is NXDOMAIN-IPv4
May 12 15:07:52 dnsmasq[11970]: query[AAAA] mithrandir.company.com from 10.10.31.15
May 12 15:07:52 dnsmasq[11970]: forwarded mithrandir.company.com to 172.17.14.19
May 12 15:07:52 dnsmasq[11970]: reply mithrandir.company.com is NXDOMAIN-IPv6
May 12 15:07:52 dnsmasq[11970]: query[A] mithrandir.com from 10.10.31.15
May 12 15:07:52 dnsmasq[11970]: forwarded mithrandir.com to 172.17.14.19
May 12 15:07:52 dnsmasq[11970]: reply mithrandir.com is NXDOMAIN-IPv4
May 12 15:07:52 dnsmasq[11970]: query[AAAA] mithrandir.com from 10.10.31.15
May 12 15:07:52 dnsmasq[11970]: forwarded mithrandir.com to 172.17.14.19
May 12 15:07:52 dnsmasq[11970]: reply mithrandir.com is NXDOMAIN-IPv6

You can see windows asks about mithrandir.company.com, then fails and tries mithrandir.com. It never tries just mithrandir which my DNS would know how to resolve.

I can't really fiddle with the settings on the Windows machines much, outside of changing the preferred DNS server.

Is there some way I can work around this issue? I really don't want my DNS to answer things for company.com since I don't own that domain and have nothing to do with it.

  • Do you actually want it to look up mithrandir without anything or mitrandir.mydomain.com ? – Reaces May 12 '15 at 7:56
  • Ideally just mithrandir, but mithrandir.argonath.mydomain.com would work too. – Cameron Ball May 12 '15 at 8:00
2

What you will need to do is configure the search domain for the Windows PC.

You haven't given details on which version of Windows you're running, but for Windows 7 (shamelessly stolen from this SuperUser answer):

  • Go to Control Panel → Network and Internet → Network and Sharing Center.
  • Click on Change Adapter Settings on the left side.
  • Right-click on your network adapter (normally "Local Area Connection") and select Properties.
  • Select Internet Protocol version 4 (TCP/IPv4) and click on the Properties button.
  • On the General tab, click on the Advanced… button.
  • In the Append this DNS suffixes list, add the domains you want, like google.com.
  • I was hoping to avoid having to do that. On Linux if there are no search domains specified, it simply queries what you ask it to. Is there any reason Windows doesn't work the same? – Cameron Ball May 13 '15 at 1:33
0

If Windows is in an AD domain, it by default appends AD domain name as its search suffix, or you can specify your own search suffix as Craig pointed out. Regardless, if you ping FQDN, it should always work. For example, if you ping "host.yourSubDomain.yourDomain.com.", it should always be resolved by the DNS server that you set up. Please note the "dot" at the end of above FQDN, it tells the resolver that this is a complete FQDN so it won't add "company.com" at the end and try to find "host.yourSubDomain.YouDomain.com.company.com"

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.