I have http server on machine inside local network(actually in LXC) and added CNAME record to DNS for my domain to point to wan address of TO where I forward ports to this local machine. Connection from outside is OK nevertheless i can not connect from inside network using full domain name - I got always router admin page.
I try several different settings but did not succeed.
Can someone explain me how to properly set this please.
Thanks
Can somebody help me uderstand what I’m doing wrong please :
I revert all settings for knot and unbound - all is in standard (i believe)
I added host name for my server to /etc/hosts with full domain name (192.168.x.x srv.example.com)
I have CNAME record in provider DNS pointing this srv.example.com to example.com
now when I check DNS record with nslookup i got this answer on linux:
Non-authoritative answer:
srv.example.com canonical name = example.com.
Name: srv.example.com
Address: 192.168.xxx.xxx
Name: example.com
Address: xxx.xxx.xxx.xxx
on windows:
Non-authoritative answer:
Name: example.com
Addresses: xxxx:xxxx:xxxx:xxxx::1 - ipv6 of router
xxx.xxx.xxx.xxx - external ip of router
Aliases: srv.example.com
ping from windows always point me to external address of router (example.com), on linux ping to srv.example.com point sometimes to internal address and sometimes to external address of router.
How to set kresd to use only internal data (from /etc/hosts) when dns request for srv.example.com is coming from local network?
Thank you.
Hi kukulin,
I am not positive this will work - I am just figuring out kresd, myself.
By /etc/hosts, you are referring to the one on your Turris router, right?
Double check that this line is somewhere in /etc/init.d/kresd
hints.config(’/etc/hosts’)
Then restart kresd:
/etc/init.d/kresd restart
I found that anytime I change one of the hint files (I have /tmp/hosts/dhcp as a hint, too), kresd has to be restarted.
Good luck.
Hi Snowkeep,
thank you for support.
Yes I refer to /etc/hosts on Omnia.
I do not have hints.config(‘/etc/hosts’) in /etc/init.d/kresd
But I can see it inside generated config : /tmp/kresd.config
at the beginning of hints:
hints.config('/etc/hosts') hints['openhab.lan'] = '192.168.xxx.xxx' hints['TITAN.lan'] = '192.168.xxx.xxx' hints['srv.lan'] = '192.168.xxx.xxx'
I also added manually hint :
hints['srv.example.com'] = '192.168.xxx.xxx'
with same IP address as srv.lan to /etc/kresd.custom.conf
and add option include_config ‘/etc/kresd.custom.conf’ inside /etc/config/resolver in section config resolver ‘kresd’
result is same
I suspect it has to do something with CNAME record - I just deleted this record in DNS and add A record updated via DDNS (I use he.net DNS service)
So I have now 2 DDNS settings in omnia :
- example.com
-
srv.example.com
I can not chack now windows machine but all my linux hosts on internal network start to regularly answer correct ip for srv.example.com and nslookup and DIG stopped to show example.com instead of srv.example.com
I’ll confirm if this is ok also on windows host evening when come back home.
So no - windows are still showing external address of router in nslookup even CNAME disappeared.
I surrender for now - add this host name to hosts file on windows pc’s
@kukulin, that sounds like the windows box(es) use a diferent DNS than the Omnia box.
As for CNAMEs, the hints are only used before any resolution (forwarding or iteration), so you have to explicitly provide hints for all aliases that you want redirected.