Documente Academic
Documente Profesional
Documente Cultură
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-nameservers
*I am leaving dns-nameserver empty and is commented we will come to it later.
nefitari
(This is my Ubuntu server hostname yours might be different .You can change this according to your
need)
Now after hostname, you have to make domain name for your server. Say servername.domain.com it is
better practice that whenever you are configuring server for home use or so, do not use .com but .hom
or .net or whatever you like. Give the below command
Code:
127.0.0.1 localhost
Named.conf.options
Named.conf.local
Named.conf.resolv.conf
Now configure file named.conf.options This file is use for DNS IPs It mean that your server must
connect to some DNS outside. When you buy domain name from ISPs they normally gives you their own
DNS IPs. You can use open DNS IPs of google or so. In my case I am using my own ISP DNS IPs.
Code:
forwarders {
# Give here your ISP DNS IPs
192.168.1.1; # gateway or router
182.176.39.23;
182.176.18.13;
68.87.76.178;
};
Save the file and exit using control x press y and overwrite the file
Now edit the file named.conf.local This is the file in which we define forward zones and reverse zones.
It means that when we enter domain name it will translate it into IP address and when we enter IP
address it will simply convert it into name.
Code:
};
# Our reverse Zone
# Server IP 192.168.1.5
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.192";
};
Save the file and exit using control x press y and overwrite the file
Now we will make these two database files db.autun.hom and db.192 in zones folder
First make the directory zones in /etc/bind/
Code:
;
; BIND data file for local loopback interface
;
$TTL 604800
@
IN
SOA
nefitari.autun.hom. webuser.autun.hom.
(
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
autun.hom.
autun.hom.
;@
;@
nefitari
gateway
win7pc
www
IN
IN
NS
A
IN
IN
IN
IN
IN
IN
A
AAAA
A
A
A
CNAME
nefitari.autun.hom.
192.168.1.5
127.0.0.1
::1
192.168.1.5
192.168.1.1
192.168.1.50
autun.hom.
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@
IN
SOA
nefitari.autun.hom.
webuser.autun.hom. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN
1
IN
5
IN
50
IN
NS
PTR
PTR
PTR
nefitari.
gateway.autun.hom.
nefitari.autun.hom.
win7pc.autun.hom.
Nameserver 192.168.1.5
domain autun.hom
search autun.hom
Enter the following lines into to your resolv.conf file and save it
Now come to dns-nameservers (/etc/networking/interfaces) *check start of the this post
you will now add the following code to /etc/networking/interfaces
Code:
dns-nameservers 192.168.1.5
reason for this is that whenever you restart server /etc/resolv.conf file wash its contents
Restart the bind
Code:
tail -f /var/log/syslog
it must not have any error in the log
host l autun.hom
Output should like this
Code:
nslookup autun.hom
OUTPUT
Code:
Server: 192.168.1.5
Address: 192.168.1.5#53
Name: autun.hom
Address: 192.168.1.5
Use DIG
Code:
Dig gateway.autun.hom
Code:
Output should similar to the above, check status: NOERROR means it is resolving check ANSWER
SECTION: gateway.autun.hom is resolved into 192.168.1.1
host 192.168.1.1
Output
Code:
Code:
nslookup 192.168.1.1
Code:
Server: 192.168.1.5
Address: 192.168.1.5#53
1.1.168.192.in-addr.arpa name=gateway.autun.hom
If you get NXDOMAIN or SERVFAIL like errors it means that one of your zone file is not
working correctly
Configuring clients
windows side
ping gateway
it must gives you some replies
similarly
Code:
ping 192.168.1.1 or 5
it must gives you some replies
you can use NSLOOKUP
Code:
nslooup gateway
LINUX CLIENTS
Code:
auto eth0
iface eth0 inet dhcp
Now restart Network Deamons
Code:
sudo dhclient -r
Now obtain fresh IP:
Code:
sudo dhclient
If you are running DHCP server on your system then enter the domain name and name server in
dhcpd.conf file for example I have DNS server named nefitari.autun.hom and IP address is 192.168.1.5
like as under
Code:
Code:
tail -f /var/log/syslog
To disable it execute command again.
Code:
logging {
channel mylog_default {
file "/var/log/mylogs/mylog.log" versions 3 size 12m;
severity dynamic;
print-time yes;
};
category default { mylog_default; };
};
After saving the file go to /var/log/ and make a mylogs folder and give it bind permission so that bind can
write to it.
Code:
/var/log/mylogs/mylog.log w,
Next, reload the profile:
Code:
Tail f /var/log/mylogs/mylog.log
Last edited by Profark; August 10th, 2013 at 03:37 PM.