Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a self hosted server with Apache2 pointed with the domain example.com. I have also some virtual servers www.example.com, cloud.examle.com, etc.

This server is in my LAN, and when I try to acces to my server within the lan throw www.examle.com y get my router's configuration page. From outside the LAN www.example.com and cloud.examle.com works properly. From inside the LAN 192.168.1.33 (server internal IP) shows the default webpage (www.examle.com), but I can not get cloud.examle.com I also have a LAN name server in 192.168.1.33 with bind9.

I set up my gateway 192.168.1.1 with my LAN-NS as primary NS

I solve this problem creating a new dns zone in the NS.

This are my config files:

;ZONE-1
$ORIGIN .
$TTL 86400      ; 1 day
home.lan. IN SOA server.home.lan. hostmaster.home.lan. (
    2008080901 ; serial
    8H ; refresh
    4H ; retry
    4W ; expire
    1D ; minimum
)
home.lan. IN NS server.home.lan.
$ORIGIN home.lan.
; Set the address for localhost.home.lan
localhost    IN A 127.0.0.1
router       IN A 192.168.1.1
server          IN A 192.168.1.33
mypc     IN A 192.168.1.132

;ZONE-2
$ORIGIN .
$TTL 86400      ; 1 day
example.com. IN SOA www.example.com hostmaster.home.lan. (
    2008080902 ; serial
    8H ; refresh
    4H ; retry
    4W ; expire
    1D ; minimum
)
example.com. IN NS 192.168.1.33
$ORIGIN examle.com.
localhost    IN A 127.0.0.1
www         IN A 192.168.1.33
cloud       IN A 192.168.1.33

My DNS and my names are working properly now

My question are:

  1. What do you think about my solution?
  2. Can I change the A zone with CNAME to server.home.lan (this is the domain in the LAN to the server)?
  3. How can I set a default IP for all my whatever.example.com?

share|improve this question

1 Answer 1

You need to ensure that your default gateway knows about the internal server being the domain controller of the .lan TLD. Personally i would enable static DNS forwarding for .lan. Once you get your DNS lookups forwarded to the correct DNS server, routing should take care of the rest, as it's all happening on your internal LAN

share|improve this answer
    
My names inside the LAN are working properly, now. I already change the default dns in my gateway to the dns inside my lan. –  Freefri Nov 12 '12 at 10:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.