iklan

3/15/14

MENGATUR KONFIGURASI IP DAN DNS

Mengatur ip computer

# /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
##allow-hotplug eth0
#iface eth0 inet dhcp

auto eth0
iface eth0 inet static
address 192.168.12.199 # ip di sesuiakan dengan kondisi anda
netmask 255.255.255.0
network 192.168.12.0
broadcast 192.168.12.255
gateway 192.168.12.1
dns-nameserver 8.8.8.8


auto eth0:1
iface eth0:1 inet static #ini adalah ip alias
address 192.168.12.249
netmask 255.255.255.0

~=====================================================
#/etc/resolv.conf

nameserver 192.168.12.199 #tambahkan agar dns berdungsi
#nameserver 180.131.144.144
#nameserver 180.131.145.145

#lalu di restart
#/etc/init.d/networking restart
===============================================
konfigurasi DNS dengan bind9

#apt-get install bin9
#/etc/bind/named.conf.local

tambahkan
zone "smknbinangun.sch.id" {
type master;
file "/etc/bind/db.smk"; #tambahkan perintah ini agar bisa membaca data
}; base sesuai yang di tujukan pada file

zone "12.168.192.in-addr.arpa" { #3 baris ip di depan di balik
type master;
file "/etc/bind/db.ip";
};

menyalin file data base
#cp /etc/bind/db.local /etc/bind/db.smk
#cp /etc/bind/db.127 /etc/bind/db.ip

mengisi data base
# /etc/bind/db.smk

; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA smknbinangun.sch.id. root.smknbinangun.sch.id. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS smknbinangun.sch.id. #nama domain
@ IN A 192.168.12.199 #ip domain
www IN A 192.168.12.199
mail IN A 192.168.12.249 #ip alis buat email

# /etc/bind/db.ip
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA smknbinangun.sch.id. root.smknbinangun.sch.id. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS smknbinangun.sch.id.
199 IN PTR smknbinangun.sch.id.
249 IN PTR mail.

merestart bind9
#/etc/init.d/bind9 restart
untuk mengecek
#nslookup nama domainnya
ex jika berhasil tamplanya seperti ini:
root@smknbinangun:~# nslookup www.smknbinangun.sch.id
Server: 192.168.12.199
Address: 192.168.12.199#53
Name: www.smknbinangun.sch.id
Address: 192.168.12.249


semoga membantu bagi yang membutuhkan

No comments:

Post a Comment