OpenWrt dnsmasq cname doesn't resolving ip of domain after a while

I have a simple cname "cname=xxx.com,yyy.com" entry in dnsmasc.conf where "yyy.com" - existing domain. Everything works fine, but after some time the router stops giving the IP address.

Server:		127.0.0.1
Address:	127.0.0.1#53

Name:      xxx.com
xxx.com	canonical name = yyy.com
Name:      yyy.com
xxx.com	canonical name = yyy.com

But if I execute the nslookup command to yyy.com from the router or even from PC, then the router immediately starts giving out the address. What could be the problem? Thanks.
dnsmasq.conf:

config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option localservice '1'

How do you know it fails sometime in the past, and now, when you do the the nslookup?

Because I can't open any link in xxx.com domain and nslookup to xxx.com not giving address. Only nslookup yyy.com help router to "recall" it. I think dns record wipe or expire somehow and dnsmasq does not request entry for cname alias.

Tried with dhcp config too. Same result.
Here is video.

It is mentioned in the wiki that you need the hostname to be created for the cname to work. Have you done that?

Do you mean assign domain xxx.com ip address of domain yyy.com through hostname? I can't do that, because ip of yyy.com is dynamic. That's why i'm trying to use cname. Thanks.

Your dnsmasq is not authoritative for the domain you are trying to resolve via cname. The resolving works until the TTL expires. A workaround would be to periodically query the rutracker dot net so that the answer is cached.

1 Like

Ok, seems it's time for cronjob. Thanks for reply!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.