Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am running a bind9 dns server at my home network, serving for all my internal servers in my domain local / 192.168.x.x - one of those, extweb.local 192.168.1.33 is also visible from the internet as home.sickel.net (well, not exactly, but you get the idea)

Is it possible to set up my internal dns so that it resolvs home.sickel.net as 192.168.1.33? All other hosts on sickel.net are run externally and should not be resolved by my internal dns.

(All this mainly to make things easier for the rest of the family, so that they always can refer to the server as home.sickel.net no matter if they are at home or accessing it through the www)

All the servers on my home network runs debian. They are all in the same subnet, connected through a single gateway to the internet.

share|improve this question
1  
You will need to describe the setup in more detail if you want valid responses. What is the layout? E.g., DSL router, home.sickel.example and the other machines at home all hang of it? What OS is home running? It would be easy enough to set-up bind in such a way that home handles all DNS queries, and passes anything OTHER than homes IPs off to your ISP DNS servers (slave set-up). –  tink Feb 15 '13 at 20:53
2  
You need to override the lookups with a home.sickel.net zone in bind. The details are here: serverfault.com/a/223958 –  mtm Feb 15 '13 at 21:30

1 Answer 1

up vote 7 down vote accepted
+50

Sure you can do it. Take a look here: https://help.ubuntu.com/community/BIND9ServerHowto#Primary_Master_Server_configuration

red@ubuntu:/etc/bind$ cat named.conf.local
zone "home.sickel.net." {
             type master;
             file "/etc/bind/db.sickel.net";
        };

red@ubuntu:/etc/bind$ cat db.sickel.net
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.
home.sickel.net. IN     A       192.168.1.33
red@ubuntu:/etc/bind$ sudo service bind9 restart
 * Stopping domain name service... bind9 [ OK ]
 * Starting domain name service... bind9 [ OK ]
red@ubuntu:/etc/bind$ dig +short home.sickel.net @localhost
192.168.1.33
red@ubuntu:/etc/bind$ dig +short sickel.net @localhost
85.19.71.164

Now just change your /etc/resolv.conf to use 127.0.0.1 as the primary nameserver.

share|improve this answer

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.