View previous topic :: View next topic |
Author |
Message |
loopx Advocate
Joined: 01 Apr 2005 Posts: 2787 Location: Belgium / Liège
|
Posted: Thu Jan 17, 2013 4:22 pm Post subject: CNAME on local Named to redirect FQDN to LAN IP ? |
|
|
Hi,
I have a little problem with my new VDSL router : port-forwarding is no more working within my LAN ... it only works when coming from Internet.
So, actually, I'm no more able to use my FQDN from the inside : no port-forwarding when reaching my VDSL router, and so, no connection to my WebServer or NAS using FQDN.
To "fix" that problem, 2 solutions :
- update /etc/hosts on all client (... hum ...)
- update local Named to redirect my FQDN to an local IP
So, I must set Named to redirect my FQDN to a local IP => I can reach my NAS. And from the outside, I will use port-forwarding of the VDSL box.
My question is : how can I told Named to redirect a FQDN to a local IP ? In fact, it's simply like "/etc/hosts" file ... but, for now, Named don't care about "/etc/hosts" of my server. Can I told Named to use "hosts" from file ? If not, how can I set a kind of "CNAME" to an IP ?
I've already tried to configure a zone .. it works ... but can't access all other sub-domains, because no more DNS request is forwarded for the domaine, and so, it's not usable.
Any idea ?
The real problem is I want to access my music from NAS using only 1 URL (from LAN or Internet).
Thx _________________ Mon MediaWiki perso : http://pix-mania.dyndns.org |
|
Back to top |
|
|
kimmie Guru
Joined: 08 Sep 2004 Posts: 531 Location: Australia
|
Posted: Wed Jan 23, 2013 7:09 am Post subject: |
|
|
net-dns/dnsmasq is designed for this sort of thing. Unless you particularly need to run named, you can just switch.
You can also use dnsmasq as a dhcp server, but find it more convenient to turn off dhcp in dnsmasq and use the dhcp in my router. The router is configured to hand out the dnsmasq address, with a second DNS server address being that of my ISP. That way my laptop still functions when I take my LAN server down. |
|
Back to top |
|
|
Mad Merlin Veteran
Joined: 09 May 2005 Posts: 1155
|
Posted: Wed Jan 23, 2013 4:41 pm Post subject: |
|
|
I concur that this is quite easy to do with dnsmasq, I currently do this. Basically, dnsmasq will serve hosts entries from /etc/hosts (unless you tell it not to), so you can use /etc/hosts on your DNS server to shadow the real DNS entries with LAN IPs for your LAN clients, otherwise, it will forward the request to upstream DNS servers.
The alternative is to enable NAT loopback on your router, then you can continue using the external IP from inside. Most routers have this option. _________________ Game! - Where the stick is mightier than the sword! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|