• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

how to create internal dns for lan

i have to configure internal dns for lan. how to create it, i am new for dns so plz guide me from beginning
thx
0
pawanopensource
Asked:
pawanopensource
  • 4
  • 3
1 Solution
 
jar3817Commented:
Most linux distros will come with Bind already installed. You should just need to edit the /etc/named.conf file to define your zones (dns domains) and options and then create a zone file, typically in /var/named/ for each zone you created in /etc/named.conf.

http://www.madboa.com/geek/soho-bind/

Then just start up named and make sure if iptables lets udp 53 through.
0
 
pawanopensourceAuthor Commented:
i had created a local dns these r the files

Vi /etc/hosts

127.0.0.1       localhost
192.168.15.2   server1.tm.local  server1

########################################################################

vi /etc/network/interfaces

auto eth1
iface eth1 inet static
      address 192.168.15.2
      netmask 255.255.255.0
      network 192.168.15.0
      gateway 192.168.15.1

##########################################################################

vi /etc/resolv.conf
search tm.local
nameserver 192.168.15.2
#########################################################################

vi /etc/bind/named.conf.local

zone "tm.local" {
        type master;
        file "/etc/bind/zones/tm.local.db";
        };


zone "3.13.10.in-addr.arpa" {
     type master;
     file "/etc/bind/zones/rev.15.168.192.in-addr.arpa";
};
##########################################################################
vi /etc/bind/zones/tm.local.db

$TTL 1500
@  IN SOA server1.tm.local. root (
                             2007062703        ;serial
                             28800             ;refresh
                             3600              ;retry
                             604800            ;expire
                             38400 )           ;minimum 25 minutes
tm.local.      IN      NS      server1.tm.local.
server1        IN      A       192.168.15.2

############################################################################

vi /etc/bind/zones/rev.3.13.10.in-addr.arpa

$TTL 1500
@  IN SOA server1.tm.local. root (
                             2007062703        ;serial
                             28800             ;refresh
                             3600              ;retry
                             604800            ;expire
                             38400 )           ;minimum 25 minutes

                     IN    NS     server1.tm.local.
2                 IN    PTR    server1.tm.local.
############################################################################

root@server1:~# dig server1.tm.local

; <<>> DiG 9.4.2-P2.1 <<>> server1.tm.local
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2915
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;server1.tm.local.              IN      A

;; ANSWER SECTION:
server1.tm.local.       1500    IN      A       192.168.15.2

;; AUTHORITY SECTION:
tm.local.               1500    IN      NS      server1.tm.local.

;; Query time: 0 msec
;; SERVER: 192.168.15.2#53(192.168.15.2)
;; WHEN: Fri Jan  8 08:58:02 2010
;; MSG SIZE  rcvd: 64


plz check the results of dig command, is local dns configured properly, though by dig server1.tm.local  ANSWER is 1


0
 
jar3817Commented:
The dig results look good to me. The only problem in your setup in with the reverse zone. In your named.conf file you have the zone defined as such:

zone "3.13.10.in-addr.arpa"

That would only work if your IP scheme was 10.13.3.x, since your is 192.168.15.x you need to change that to:

zone "15.168.192.in-addr.arpa"
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
pawanopensourceAuthor Commented:
thx for guidance i am working on it.
0
 
pawanopensourceAuthor Commented:
ok edited the files. as now i am having local DNS, in my local lan only i had configured a Openvpn whose ip is 192.168.15.3 where should i enter the ip of vpn n why we enter the servers ip in DNS.

do i have to edit these files like this.

vi /etc/bind/zones/tm.local.db

$TTL 1500
@  IN SOA server1.tm.local. root (
                             2007062703        ;serial
                             28800             ;refresh
                             3600              ;retry
                             604800            ;expire
                             38400 )           ;minimum 25 minutes

tm.local.      IN      NS      server1.tm.local.
server1        IN      A       192.168.15.2
vpn               IN      A       192.168.15.3

##########################################################################

 vi /etc/bind/zones/rev.15.168.192.in-addr.arpa

$TTL 1500
@  IN SOA server1.tm.local. root (
                             2007062703        ;serial
                             28800             ;refresh
                             3600              ;retry
                             604800            ;expire
                             38400 )           ;minimum 25 minutes

                     IN    NS     server1.tm.local.
2                  IN    PTR    server1.tm.local.
3                  IN    PTR    vpn

############################################################################
0
 
jar3817Commented:
Huh? I'm not quite sure what you're asking.

Those edits should work fine. That would create:

vpn.tm.local -> 192.168.15.3
192.168.15.3 -> vpn.tm.local

You should always increase your serial number in the SOA record for every change you make though. It doesn't really make a difference if you have 1 server, but if you have more than 1 that's how they know they need to do a zone transfer. Typically the serial number is in the format of the date+revision number:

yyyymmddXX for today would be 2010010801, where the last two digits are the number of changes you made that day. 01 for the first change, 02 for the second....etc.
0
 
pawanopensourceAuthor Commented:
thx for ur support buddy, friend i am installing zimbra while compiling i get this error message

############################################################################
DNS ERROR resolving MX for server1.tm.local
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes]
Create domain: [server1.tm.local]


DNS ERROR resolving MX for server1.tm.local
It is suggested that the domain name have an MX record configured in DNS
Re-Enter domain name? [Yes]

############################################################################

thx
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now