G+_Jeff Gros Posted November 30, 2016 Share Posted November 30, 2016 I've got a DNS issue that I'm hoping someone has come across before. I recently setup an Edge Router X that is distributing IP addresses through DHCP. I have a device that is given an address through DHCP as well, but always issuing the same address. To make this device easy to connect with using a hostname, I added an entry in the hosts file of the Edge Router X. It works great!.....Except for on my Windows machines. It works on Linux/Apple/Android devices with no issues, but none of my Windows machines. Of course I can add the entry to the hosts file of each Windows machine on the network, but that is so...inelegant. nslookup for the device gives the correct result. For example, nslookup deviceDomain Server: Unknown Address: 192.168.1.1 (Edge Router) Name: deviceDomain Address: 192.168.1.2 (device I want to access) Any ideas? Link to comment Share on other sites More sharing options...
G+_Ben Reese Posted November 30, 2016 Share Posted November 30, 2016 I'm not an expert, but here's my advice anyhow... I suspect the host file on the router is used by that router only and not the rest of devices connected to it - especially if the DNS on other devices is set to something other than the Edge Router (such as 8.8.8.8). If DNS Services is enabled on the router, you may just need to update the DNS settings on your computer. I had a similar issue a few years ago. The mapped network drive on a laptop would go offline and wouldn't reconnect on its own. I ended up creating a batch script that pinged the IP (with -a), pinged the hostname, then opened the mapped drive in Windows Explorer. Worked every time. Here's another set of steps that might be helpful. I use /flushdns at work occasionally if we're changing IPs on servers for whatever reason. https://social.technet.microsoft.com/Forums/office/en-US/f82b747e-6711-418b-9b6f-317223daa2dc/access-computers-by-ip-addresses-but-not-by-computer-name?forum=w7itpronetworking Link to comment Share on other sites More sharing options...
G+_Jeff Gros Posted November 30, 2016 Author Share Posted November 30, 2016 I'm no expert either but my understanding is that devices that take an address through DHCP get their DNS from the router. Before the router passes the buck to openDNS, it should look in its host file. See this link on setting up local DNS on the Edge Router: https://community.ubnt.com/t5/EdgeMAX/Setting-up-Local-DNS/td-p/449259 It's just so weird. It works for every device but the Windows devices. Its working for my linux machines, my phone and tablet. I just don't get it. Link to comment Share on other sites More sharing options...
G+_Ben Reese Posted November 30, 2016 Share Posted November 30, 2016 Jeff Gros well, maybe... I pulled up the config page on my ISP-provided router and it has an option for DNS relay. I presume in that mode it will act as a DNS server itself and tell all the clients to use it as the DNS server then it will connect to OpenDNS and get the information it needs... Maybe the Edge Router does intercept all outbound DNS queries and compares to its cache, but I doubt it. Link to comment Share on other sites More sharing options...
G+_Ben Reese Posted November 30, 2016 Share Posted November 30, 2016 I guess the way to test that would be adding a site to your host file on the router - like facebook.com 10.10.10.10 and test it on all your machines (may need a flushdns first). Then, as long as DNS services is running on the Router, you can set your router's IP as the DNS server on Windows (can be set even if it's pulling DHCP) and test again. Link to comment Share on other sites More sharing options...
G+_Jeff Gros Posted December 2, 2016 Author Share Posted December 2, 2016 I've got a solution that I've got working and I thought I would share. Let's say that the host name is "mydevice". If I set up the static mapping in the ERX to be "mydevice", then linux boxes work but not windows. I believe this is because Windows requires fully qualified domain names (FQDN), like .com, .local, etc. If I set the mapping to be "mydevice.local", then windows boxes work but not linux. It seems that ".local" is registered as mDNS, which in Linux has greater precedence than querying DNS. If I set it to be "mydevice.private" (or probably anything else!), then they all work. Anyone feel free to chime in if they understand this better. My brain hurts. I think the host file edit was easier... Link to comment Share on other sites More sharing options...
Recommended Posts