Can't reach internal servers on my network

I do apologize in advance if this has been asked before, but I have been struggling trying to figure out why I can't reach my internal servers locally with a domain cname when going through dnsmasq.

/etc/config/dhcp:

config dnsmasq
	option domain 'lan'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option nonwildcard '1'
	option rebind_protection '0'
	option filterwin2k '1'
	option nonegcache '1'
	option domainneeded '1'
	option sequential_ip '1'
	option localise_queries '1'
	option localservice '1'
	option local '/lan/'
	list server '1.1.1.1'

config dhcp 'lan'
	option interface 'lan'
	option leasetime '12h'
	option force '1'
	option ra 'server'
	option start '2'
	option limit '248'
	option ra_default '1'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

config domain 'localhost'
	option ip '192.168.1.1'
	option name 'router.com'

/tmp/resolv.conf.auto:

root@GL-MV1000:~# cat /tmp/resolv.conf.auto
# Interface wan
nameserver 1.0.0.1
nameserver 1.1.1.1

When I do an nslookup of anything other than my domain cname server it works great, but if I try mine it gives me a:

Server:		127.0.0.1
Address:	127.0.0.1#53

Name:      mycname.mywire.org
Address 1: 166.xx.xx.xx
*** Can't find mycname.mywire.org: No answer

I just need to understand what is going on to make sense of it.

This is a successful reply:

Perhaps you are expecting something else?

1 Like

I am expecting to reach my outside cname internally in my web browser at home. Dnsmasq seems to prevent the forward lookup, and I thought disabling rebind protection would solve something like this which it has not.
I just need a little help.

Can you provide information confirming that you have configured a CNAME?

A typical CNAME record looks like this:
https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#cname_rr

# nslookup mail.yahoo.com
Server:		127.0.0.53
Address:	127.0.0.53#53

Non-authoritative answer:
mail.yahoo.com	canonical name = edge.gycpi.b.yahoodns.net.
Name:	edge.gycpi.b.yahoodns.net
Address: 87.248.114.11
...

I figured it out, I had to put my domain name into Network>Hostnames and map it to the local IP of the server. Now it connects internally and my cnames from my domain DNS records work locally.
Sorry for the confusion.

2 Likes

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