DrayTek UK Users' Community Forum

Help, Advice and Solutions from DrayTek Users

Local DNS resolving for DHCP clients

  • neilsimms
  • Topic Author
  • User
  • User
More
25 Oct 2020 12:35 #1 by neilsimms
Local DNS resolving for DHCP clients was created by neilsimms
Router: Vigor 2762ac
Firmware: 3.9.4_BT

I'm looking for help setting up this router so that local clients can find other machines on the same lan.

Example set up: 2 linux hosts p1 and p2. Both configured to get their IPs from DHCP. Both can connect to the internet and resolve hostnames for external servers (eg www.draytek.co.yk). However neither can resolve the other's hostname. ie from p1:

ping p2
dig @192.168.1.254 p2 (The router is on 254, not the default 192.168.1.1)
nslookup p2

All fail to resolve p2 to an IP address.

Both p1 and p2 are visible in the router's DHCP table.
I have tried 'Bind IP to MAC' - that fixes the IP but does not help resolve them.
I have tried LAN >> General Setup >> DNS Server IP Address as blank or as the router's IP, the IPS's DNS, and 1.1.1.1, but no change.
I have also tried Applications >> LAN DNS / DNS Forwarding, adding in a domain of *.local, with the router as the DNS server. Sometimes my client will resolve p2.local, but after 5 mins it stops resolving.

The Ideally, I want my local machines to get all their IP settings from DHCP, be able to resolve other local hostnames, and use an external DNS (like Cloudflare) for anything external.

I've not found an answer in the Draytek FAQ and Knowledge Base documents.

Please Log in or Create an account to join the conversation.

  • hornbyp
  • User
  • User
More
25 Oct 2020 18:58 #2 by hornbyp
Replied by hornbyp on topic Re: Local DNS resolving for DHCP clients
From what I can make out, the Vigor's DHCP server does not automatically add entries to the Vigor's DNS Server (when it hands out an IP address).

I think the only way to add entries (as opposed to ones it caches), is to use "LAN DNS / DNS Forwarding"

The questions seems to be, what to use for the 'domainname' part of the entry?.

Maybe it should match whatever 'domainname -d' gives on the linux box. Or possibly, you can use * wildcards (the Draytek documentation shows this in use).

Please Log in or Create an account to join the conversation.

  • neilsimms
  • Topic Author
  • User
  • User
More
26 Oct 2020 07:15 #3 by neilsimms
Replied by neilsimms on topic Re: Local DNS resolving for DHCP clients
Hi hornbyp,

Thanks for the reply.

From what I can make out, the Vigor's DHCP server does not automatically add entries to the Vigor's DNS Server (when it hands out an IP address).



That's rather disappointing.

Taking you advice, I added several entries in "LAN DNS / DNS Forwarding".
I've not set a domain name in any of my local machines, so `domainname -d` gives an empty response.

The entries I created have '*.local' in the domain, a CNAME with te host, and the IP added.
I can now resolve both 'host' and 'host.local' to that IP.

Please Log in or Create an account to join the conversation.

  • hornbyp
  • User
  • User
More
26 Oct 2020 13:42 #4 by hornbyp
Replied by hornbyp on topic Re: Local DNS resolving for DHCP clients

hornbyp wrote:
From what I can make out, the Vigor's DHCP server does not automatically add entries to the Vigor's DNS Server (when it hands out an IP address).


I suppose, with hind-sight, it doesn't actually have enough information to do that - it only has MAC, IP (and a comment string for Bind2Mac entries)

It seems to behave as transparent cache for "A" records only, with the only means of manually adding things being via the Vigor's GUI/Telnet interface.
(I tried adding "A" and "CNAME" records via the Windows 'dnscmd' command - but it was having none of it.)

Please Log in or Create an account to join the conversation.

  • neilsimms
  • Topic Author
  • User
  • User
More
27 Oct 2020 19:44 #5 by neilsimms
Replied by neilsimms on topic Re: Local DNS resolving for DHCP clients

... it doesn't actually have enough information to do that - it only has MAC, IP (and a comment string for Bind2Mac entries)



I think it does have enough information to do this. Looking at the DHCP table, it is getting the hostname from the client. So it would not be impossible to for the router to add it to DNS. It just doesn't.

My previous (ISP supplied) router did work this way - if a machine called itself 'host' got an address from DHCP, then 'host.lan' would be resolved by the router to the IP it gave. That router had to go - it had no way of changing the DNS server :shock:

I have contacted Draytek support. They've sent a link to https://www.draytek.co.uk/support/guides/kb-lan-dns which covers the "LAN DNS / DNS Forwarding" that we've already discussed.

Please Log in or Create an account to join the conversation.

More
31 Oct 2020 19:32 #6 by the pit
Replied by the pit on topic Re: Local DNS resolving for DHCP clients
Never has this issue with linux boxes on a mixed lan with mac and windows, Had to tweak linux slightly to get it too work. Can't remember how now but U think it's more of an os issue than a draytek issue. Try posting on linuxquestions.org

Please Log in or Create an account to join the conversation.