Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CNAME on local Named to redirect FQDN to LAN IP ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
loopx
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2787
Location: Belgium / Liège

PostPosted: Thu Jan 17, 2013 4:22 pm    Post subject: CNAME on local Named to redirect FQDN to LAN IP ? Reply with quote

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
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Wed Jan 23, 2013 7:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Wed Jan 23, 2013 4:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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