LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-20-2015, 02:25 AM   #1
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 9, SH4, Debian
Posts: 367

Rep: Reputation: 8
DNS server for local network


I want to configure nameserver for local area network. My registered host in Internet DDNS system is <my_host>.ddns.net

I want to use for my local network usage (not Internet) internal address like:

host1.ddns.net
host2.ddns.net
etc
and of course router as <my_host>.ddns.net

As I wrote I use NO-IP DDNS system to access from internet my router (and the rest of local network by ports) as <my_host>.ddns.net

So my zone definition file looks like this:

Code:
[root@mackowiak named]# cat ddns.net.hosts 
$ttl 38400
ddns.net.       IN      SOA     mackowiakp.ddns.net. 192.168.0.7 (
                        1431270668
                        10800
                        3600
                        604800
                        38400 )
ddns.net.       IN      NS      mackowiakp.ddns.net.
mackowiakp.ddns.net.    IN      A       192.168.0.7
tv.ddns.net.    IN      A       192.168.0.121
localhost   IN      A     127.0.0.1
so if I query form local network, local network located nameserver it answers correctly. Just like example below:

Code:
[maciek@piotr ~]$ nslookup tv.ddns.net 192.168.0.7
Server:         192.168.0.7
Address:        192.168.0.7#53

Name:   tv.ddns.net
Address: 192.168.0.121
but if I query about physically existing in ddns.net domain node, but not located in my local network it can not find out it. Just like in example below:

Code:
[maciek@piotr ~]$ nslookup lilith.ddns.net 192.168.0.7
Server:         192.168.0.7
Address:        192.168.0.7#53

** server can't find lilith.ddns.net: NXDOMAIN
This is my named.conf file:

Code:
[root@mackowiak named]# cat /etc/named.conf

options {
        listen-on port 53 { any; };
        directory       "/var/named";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { localhost; 192.168.0.0/24; };
        recursion yes;

        dnssec-enable no;
        dnssec-validation no;
        dnssec-lookaside no;

        forwarders {
                208.67.222.222;
                208.67.220.220;
                };
        forward first;
};

logging {
        channel default_debug {
                file "/var/named/data/logi";
                severity dynamic;
                };
};


zone "ddns.net" {
        type master;
        file "/var/named/ddns.net.hosts";
        };
How to set up DNS server to work that way that all queries to local DNS about ddns.net domain will will be forwarded to any public DNS server, if not found in local DNS.
Of course proble is only with ddns.net domain because other domains/hosts are resolved properly. Just like this:

Code:
[maciek@piotr ~]$ nslookup www.playboy.com 192.168.0.7
Server:         192.168.0.7
Address:        192.168.0.7#53

Non-authoritative answer:
www.playboy.com canonical name = g.global-ssl.fastly.net.
Name:   g.global-ssl.fastly.net
Address: 185.31.17.65
Is it possible at all? Any help please!
 
Old 05-20-2015, 05:17 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
You can not just go adding yourself onto someone else's domain and hope that it will work. It won't.

If you want internal names then you setup your network to use the ".local" domain as that is reserved for local networks.
 
Old 05-20-2015, 05:38 AM   #3
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 9, SH4, Debian
Posts: 367

Original Poster
Rep: Reputation: 8
OK. But I use several apps like OwnCloud located on my home server. At this moment it is necessary to have two configs for each service, first for use when I am outside my home lan and second for internal home usage.
Is it possible to address in both cases (inside or outside my house) as <my_host>.ddns.net. That is using the same domain? If so any example?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to Use BInd9 as a local DNS server for my Network nickn0ck Linux - Server 7 03-22-2015 08:59 AM
can a local DNS Server be used to handle dns requests going out to the internet baronobeefdip Linux - Server 1 07-03-2012 03:19 AM
DNS caching server on local network rajcan Linux - Software 7 07-02-2011 01:13 PM
Redirect local DNS query to remote DNS server on non standard port? rock_ya_baby Linux - Server 8 04-13-2010 04:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration