What's new

[AC86U, Merlin 384.14_2] Add CNAME to DNS server

  • 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!

Patrick9876

Regular Contributor
I need to change the host name of a NAS drive because I used an "invalid" character in it's name. (Nothing in my network seems to care except a QNAP NAS that accepts only regerously conforming DNS names. So I need to change DS281_1 to DS218-1 if I want my QNAP NAS to talk with my Synology NAS..

I temporarily want both the old and new name resolve to the DHCP-supplied IP address. So I think I want to add a CNAME record to the router's DNS server's config.

I know just enough about DNS servers to be dangerous. I don't know enough about the ASUS router, Merlin, or Linux to know if I'm being dangerous or not.

I've looked at "Custom domains with dnsmasq" at https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-domains-with-dnsmasq
That doc says "Enable JFFS custom scripts and configs". Since I've never enabled it before, do I also need to "Format JFFS partition at next boot". If "yes", does that option turn back off after the next boot? Is there any downside or danger in turning on JFFS?

That doc has the user (creating and) editing "/jffs/configs/dnsmasq.conf.add". Does that file contain additions to what Merlin already uses, or does it override the existing definitions so I need everything needed to make the DNS server work? (I assume the "add" in the file name implies additions, but I've been wrong before.)

I think I just want to add (if I make the router change before renaming the NAS)
--cname DS218-1,DS218_1
or (if I make the router change before renaming the NAS)
--cname DS218_1,DS218-1
 
That doc has the user (creating and) editing "/jffs/configs/dnsmasq.conf.add". Does that file contain additions to what Merlin already uses, or does it override the existing definitions so I need everything needed to make the DNS server work? (I assume the "add" in the file name implies additions, but I've been wrong before.)
It's a true add to the existing configuration...
I think I just want to add (if I make the router change before renaming the NAS)
--cname DS218-1,DS218_1
or (if I make the router change before renaming the NAS)
--cname DS218_1,DS218-1
You don't include the leading -- when adding options to the conf.add
 
Very strange. I have not achieved my desired results, but I think I've confused my router, and it doesn't matter whether I've got scripts and configurations enabled or not.

I've got two Synology NAS devices. Both have an unacceptable character in thier host names (as far as the DNS RFC is concerned). I don't recall that this has ever bothered my router before, but now neither of the NAS names show in the router's list of "clients". One of the devices shows with the name "Synology"; the other does not show at all. However, Windows has no trouble accessing both of the NAS devices by name ... even after I flushed the Windows DNS cache. However, an nslookup for either of the names fails.

Looking more closely, I see that when I issue a ping for "DS218_1" Windows says it is pinging "DS218_1.local". The router's domain name is "OF-LAN".

I think I've broken something.
 
Well, I've deleted the config file and rebooted the router. Twice. Once with "Enable JFFS custom scripts and configs" set to "Yes" and once set to "No". No difference.

If the DSN server failed to start wouldn't there be an error in the log? I didn't see any, but there's a lot in the log. I'll check again.

In the mean time, is there anything I can do short of doing a factory reset and re-entering everything?
 
Well, I've deleted the config file and rebooted the router. Twice. Once with "Enable JFFS custom scripts and configs" set to "Yes" and once set to "No". No difference.

If the DSN server failed to start wouldn't there be an error in the log? I didn't see any, but there's a lot in the log. I'll check again.

In the mean time, is there anything I can do short of doing a factory reset and re-entering everything?
If you upload the entire log to pastebin we can have a look at it.
 
I've never used Pastebin befor so I have no idea if I've succeeded.
https://pastebin.com/yzapjJa2
If that is not the right link I'll put in Box.com (which I use almost daily.)
The log goes back 2 weeks, but I didn't want to edit anything.

And in the mean time, I'm going back to my old RT-AC87U which should still have a working configuration.
Update: Too bad I can't remember the userid/password.
 
Last edited:
OK you can delete that upload now. There's nothing useful in it. In fact there's not even the usual messages, which makes me think that the log level has been changed to suppress the messages or they've been redirected to another file.

Anyway, I think the quickest solution would be to factory reset the router, even if it does mean reentering the settings. If you have a recent backup of the config you could reload that after the factory reset.
 
I'm beginning to think I've never noticed my configuration's behavior in the past. My AC87U is acting just like my AC76U. An nslookup of either of my Synology NAS drives fails and a ping shows domain name of "local". An nslookup of my QNAP NAS or my computers show a domain name of OF-LAN.

I suspect the DNS server never has worked for the Synology devices. My various computers and the NAS devices themselves must be using what ever network discovery techniques they've got and are not depending on the DNS server. And I'm guessing the problem is the underscore I put in their host names. (Although that doesn't seem to bother DHCP. The router dutifully gives them an IP address.)

I'll switch back to mu AC76U, change the name of one of the NAS drives, and see what happens. I can do the factory reset if I still seem to have problems.
 
@Patrick9876 "AC76U"? Never heard of such a model for Asus routers?
 
One of my many typos. AC87U.

This thread now switches from my needing to solve a problem to my wanting to understand how the DSN server in these routers works.

After my various rebootings of the routers - both AC86U and AC87U - my Synology routers - with host names DS218_1 and DS218_2 - would, at first, not show in the router's list or clients or would eventually show with the name "Synology". I was pretty sure this had not been the case before, but I could not remember for sure. And since there was no difference between the routers, I switched back to my AC86U,

Thinking (as I've mentioned before) that the problem might be due to the use of an underscore in the host names so I changed DS218_1 to DS218-1. I expected the device to quickly appear in the router's list of clients, but it did not. So I spent the next hour finding and changing all references to the old NAS name. By the time I was done I noticed that DS218_2 (!) was in router's client list. I went to bed.

This morning I checked and nslookup finds both DS218-1 and DS218_2 in the DNS server, showing them as part of my OF-LAN domain. (The name DS218-1 does not show in the router's client list because I foolishly manually changed the displayed name yesterday. I can change the name to anything I want, but I don't know how to let the router pick its default name.)

So, finally, some questions:

  • Does the router's DHCP server pass information to the DNS server about names it has found, or does the the DNS server use some sort of discovery?
  • When does the DHCP server pass this information, or how often does the DNS server do it's discovery? (It took a long time for the NAS names to become part of the DNS server's information.)
  • Is the router's DNS server authoritative for the addresses doled out by the DHCP server? In other words, does the DNS server have A records for those names?
  • If the DNS server (eventually) has an A records for my NAS names, would my CNAME record have eventually worked, or does the A record have to exist when the CNAME record is processed?
 
  • Does the router's DHCP server pass information to the DNS server about names it has found, or does the the DNS server use some sort of discovery?
Neither. DHCP servers don't "find" anything. Likewise, DNS servers don't do any kind discovery. It is the client that registers its host name with the DNS server. However this is not necessary if you have manually created DNS entries in the DNS server.
  • When does the DHCP server pass this information, or how often does the DNS server do it's discovery? (It took a long time for the NAS names to become part of the DNS server's information.)
See previous answer. It's likely the client renewed its DHCP lease and re-registered it's host name at the same time.
  • Is the router's DNS server authoritative for the addresses doled out by the DHCP server? In other words, does the DNS server have A records for those names?
Effectively yes. Although "authoritative" and A records are two different things.
  • If the DNS server (eventually) has an A records for my NAS names, would my CNAME record have eventually worked, or does the A record have to exist when the CNAME record is processed?
The CNAME will work. I've just tested it. ;)
 
I failed to get this to work and let it sit around for about 5 months, then tried again. I discovered I had to use fully qualified names in the CNAME record. (At least I got it working after using fully qualified names.) I've read that some DNS servers can process unqualified names (by appending the domain name). Is that true for dnsmasq? If so, I obviously had some other problem.

Since the domain name is set via a parm in the router's dashboard (or control panel, or whatever it's called), it would be nice if I did not have to specify it in the CNAME record. I doubt I'm ever going to change the domain name, but if I do I would want the names in the CNAME record to change, too.

BTW (and a bit off-topic), while researching this I read the statement " Domains that are used for e-mail may not have a CNAME record - this can have undesirable results with different mail servers ". One of the host names I've created by CNAME is specifically for email - for a small email system with the server and agents all on my LAN. Luckily I got this system working before reading that it wouldn't work. Any idea what that statement is about?
 

Latest threads

Sign Up For SNBForums Daily Digest

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