What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

dsnmasq cname infor lost after reboot

Patrick9876

Regular Contributor
The subject of the post is very poorly worded.

I have a dnsmasq.conf.add file with a couple cname records adding host names to a NAS. After a reboot of the router the router's DSN does not know about these cnames. I have to disconnect and reconnect the NAS Ethernet cable in order for the DSN to get those cnames. I assume the disconnection and reconnection of the NAS cable prompts DHCP to give the NAS it's IP address and that somehow prompt the router's DSN to become aware of the cnames.

Note that all connectivity in the network is fine after the reboot. I can get to the NAS using its real host name with no problem. It's just those cnames that are unknowm.

Is there some way to get the router to automatically do whatever DNS magic is needed without the reconnection of the NAS? I don't always remember that step until I notice a bunch of connection failures because of unknown names in the DSN.

I currently have an AX86u running 3004.388.10 but this has been happening over the years with at least 2 routers and many releases. I assume this is intended behavior, but it's very inconvenient.
 
Is the NAS connected directly to the router via ethernet, or is it going via an intermediate switch?

Is the NAS's network interface configured as a DHCP client or is it manually configured? (I'm assuming you already have a DHCP reservation on the router)


EDIT: Déjà vu

This appears to be the same problem you reported here:


and here:
 
Last edited:
Yup. Same problem. I forgot I reported it back then.

My connection is now going through a switch. (It apparently was not back when I first reported this.)

The NAS gets its address via DHCP. And there is no problem accessing it with its address or actual host name after the reboot. It's just the CNAMEs that are unknown on the LAN.

Back in one of those threads you said
That's my point, the host name (and therefore an IP address, although that's irrelevant for our purposes) must be set on the router not just the NAS. The reason being, as you have seen before, is that there seems to be an issue with the NAS where it doesn't always register its name with the DNS server when it should. When this happens the name resolution will fail. The solution is to either fix the errant behaviour of the NAS, or work around the problem by setting the host name on the router.
But as near as I can see the NAS always does register it's name with the DNS server. It's just the additional CNAMEs that don't get registered.

Or maybe I'm wrong. The router's DHCP has been giving the NAS the same address since the router was installed and configured so it is obviously saving the name/address combination (indexed by the NAS MAC address, maybe?). Maybe the DHCP handshake is not actually happening when the router is booted and DHCP does it's initial processing. So you could be right about errant behavior in the NAS. (Sorry I didn't reason that out when you first said that 5 years ago.)

Do you know where I can find a good description of DHCP data flow when a DHCP server first starts up?
 
I'll have to test the CNAME behaviour again to see if it's changed over the last 5 years.

EDIT:
OK I've tested this again and the previous solution should still work. Or at least it does on my router.
 
Last edited:
I have a dnsmasq.conf.add file with a couple cname records adding host names to a NAS.
For context, might help if you post the dnsmasq.conf.add file.
 
Code:
cname=ds218-2.of-lan,lanmail.of-lan,ds218_2.of-lan

Not very exciting.
So have you made a corresponding reservation on the router's LAN - DHCP Server page for host ds218_2 ?

What does nslookup ds218-2.of-lan and nslookup lanmail.of-lan return when run on the client that has the problem resolving the name?
 
Last edited:
So have you made a corresponding reservation on the router's LAN - DHCP Server page for host ds218_2 ?

What does nslookup ds218-2.of-lan and nslookup lanmail.of-lan return when run on the client that has the problem resolving the name?
Sorry to be dense, but I'm not sure how to interpret your first question. I haven't made any reservations. DHCP finds all active devices on my LAN when it comes up and assigns IP addresses to them. (It apparently caches those MAC/IP addr associations because it gives each device the same IP addr it gave out before.)

I can't conveniently reboot my router right now to get back into that "unknown" state so I can't give an exact answer to your nslookup question. It an "unknown" or "unreachable" kind of response. When I suspect my LAN is in this state I do nslookup (or ping) to lanmail and ds218_2. It fails for lanmail and succeeds for ds218_2.
 
Sorry to be dense, but I'm not sure how to interpret your first question. I haven't made any reservations. DHCP finds all active devices on my LAN when it comes up and assigns IP addresses to them. (It apparently caches those MAC/IP addr associations because it gives each device the same IP addr it gave out before.)
As I explained in your original thread, a DHCP server doesn't "find" anything. Because your NAS isn't directly connected to the router it doesn't know that the router has rebooted. Therefore it doesn't re-register it's host name in DNS. You need to make a manual reservation for this hostname on the router's LAN - DHCP Server page.
 
It apparently caches those MAC/IP addr associations because it gives each device the same IP addr it gave out before.
It isn’t cached. The dnsmasq algorithm to allocate an IP is deterministic based on the lease start/end IPs and the client MAC address.
 
As I explained in your original thread, a DHCP server doesn't "find" anything. Because your NAS isn't directly connected to the router it doesn't know that the router has rebooted. Therefore it doesn't re-register it's host name in DNS. You need to make a manual reservation for this hostname on the router's LAN - DHCP Server page.
OK. A look at the DHCP protocol shows that you are obviously right about the DHCP server not finding anything. The DHCP handshake is initiated by the client; if the client does not make a request then the server does nothing.

On to manual reservation. This sounds like defining a static IP address (plus optional host name and DNS server) done within the DHCP server. I've always avoided static IP addresses for no obvious reason. (A hold-over from mt per-retirement days when large numbers of static addresses resulting in record-keeping nightmares.) But I guess if DHCP is always going to give out the same address I might as well pre-populate the information in the router. I'll try it.

Hmm. Too bad I can't safely reboot right now ... and lose a backup that's been running for 6 hours.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top