Solved

How to make DNS Server work with intranet on Unbutu Server?

Posted on 2007-04-02
2
406 Views
Last Modified: 2011-09-20
Hi all,

  I want to set up a test environment for the Web Developing,so download a Unbutu Server 6.10, installed it on a old PC.

  I had setup the apache well....

  But on the intranet, something not work for me.

  I am using Netgear WNR854T for the broadband router. And all computer are using static IP base on 192.168.218.x, and all computer's DNS is setting to using ISP's DNS ....

  On my environment, here are the setting:

  PC A (Developmet Workstation)
  IP: 192.168.218.61
  Sub mask 255.255.255.0
  Gateway: 192.168.218.1
  DNS1: 218.102.66.71 (Want to change to using 192.168.218.121 also can resolv domain name)

Linux Server (full name is linux.testserver.org)
IP 192.168.218.121
Sub mask 255.255.255.0
Gateway: 192.168.218.1
DNS: 192.168.218.121


  The big problem is, while I change the DNS value from the ISP one to the Unbutu one, like from 218.102.66.71 change to 192.168.218.121 (The Intranet Linux Server DNS IP) on my workstation

  Try using nslookup on my workstation and the linux server It will time out, and can not resolv any domain name, both the Linux Server itself and the client, but if using the ISP' DNS server, the Linux server can resolv domain name ....

  The Router's Gateway is 192.168.218.1, and the Unbutu Server IP setting are like that.

in   /etc/resolv.conf
search testserver.org
nameserver 192.168.218.121
nameserver 192.168.218.1
-----------------------------------------------

in /etc/bind/named.conf

zone "testserver.org" {
    type master;
    file "/etc/bind/zone.testserver.org";
};
--------------------------------------------------------------

in /etc/bind/zone.testserver.org
$TTL    3600
@       IN      SOA     linux.testserver.org. root.localhost. (
                              1         ; Serial
                           3600         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                          86400 )       ; Negative Cache TTL
;
@       IN      NS      linux.testserver.org.
@       IN      A       192.168.218.121
www     IN      A       192.168.218.121
ftp     IN      A       192.168.218.121

It is all, how to setting the Unbutu DNS Server work on my intranet, since if it not work, I can not make a test environment to development the web site like enter this type of domain name ...

 www.microsofttest01.com, etc ....

It just time out while my workstation change from using ISP's DNS to the Linux Server one.

Thx for your time.
0
Comment
Question by:explorer1979
2 Comments
 
LVL 5

Expert Comment

by:NickVd
ID: 18838885
You could always just use http://localhost for your development purposes, as it's what I use on my development machine.

Now, to your question (as I also have a setup like you are using for the other pc's in the office to connect to my machine easily)

What I did was create a new TLD (top level domain [.com .net .org]) named .int (for internal) as such:

zone "int" {
        type master;
        file "/etc/bind/db.int";
};

That way, I am able to create my own second level domain names for my various projects that I want the other people to easily access, since it's my own DNS system, I'm able to create any domain I want, and point it to any ip address I want.

$TTL    86400
@       IN      SOA     int. admin.localhost. (
                         200703156              ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                          86400 )       ; Negative Cache TTL
;
@       IN      NS      ns.int.
ns      IN      A       192.168.0.3 ; the dns server itself
nick    IN      A       192.168.0.127 ; my development machine on a static dhcp address
; the rest are just cnames for utilities on the local server
; to activecollab.int will load my companies install of active collab
staging IN      CNAME   ns
activecollab    IN      CNAME   ns
backup  IN      CNAME ns
passgen IN      CNAME   ns
;pma    IN      CNAME   ns

; I could have just as easily done this in order to have a domain pointed to my dev machine like so.
newwebsite     IN     CNAME     nick

; Or To a specific address not already defined
clients_site      IN     A     the.hosts.ip.addr


my resolv.conf:

nameserver 127.0.0.1
nameserver my.isps.dns.server

That should be enough to get you started.  I'm also using an ubuntu server for my dns/web/ftp/db.

Just remember to restart bind when changing the bind config, amd reload it when changing the zone files. (/etc/init.d/bind9 reload/restart)
0
 
LVL 35

Accepted Solution

by:
ShineOn earned 125 total points
ID: 18840837
Another option would be to set up forwarding, so anything not resolvable by your new DNS server is forwarded by the DNS server to your ISP...

Add an options section at the top of your named.conf

options {
  forwarders {218.102.66.71;};
  forward only;
  // disables all zone transfer requests
  allow-transfer{"none";};
  // Closed DNS - permits only local IPs to issue queries
  // remove if an Open DNS required to support all users
  // or add additional IP ranges
  // in this case either allow-query or allow-recusrion can be used
  allow-query {192.168.218.0/24;};
};

This will create a local DNS cache, and will forward all non-Master-zone requests to your ISP's DNS unless it's in cache.

You should also set up a reverse-lookup zone to balance your forward-lookup zone, if you're going to have more hosts in your internal DNS...:

in /etc/bind/named.conf

zone "218.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/zone.218.168.192.in-addr.arpa";
};

in /etc/bind/zone.218.168.192.in-addr.arpa:

218.168.192.in-addr.arpa.      IN      SOA      linux.testserver.org. root.localhost. (
                              1         ; Serial
                           3600         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                          86400 )       ; Negative Cache TTL
;
@     IN     NS    linux.testserver.org
121  IN  PTR  linux.testserver.org
)
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will assume you are running a non-server version of some sort of Windows throughout this article. There are many flavors of Windows since Windows Server 2000 - 2008, XP Home & Pro, Vista Home & Pro, and Windows 7 Starter, Home, Pro, Ultimate, etc.…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question