Tuesday, November 20, 2007

Howto: Setup a DNS server with bind

Step1: Install bind 9
Step2: vi /etc/bind/named.conf.local
# This is the zone definition. replace example.com with your domain name
zone "example.com" {
type master;
file "/etc/bind/zones/example.com.db";
};

# This is the zone definition for reverse DNS. replace 0.168.192 with your network address in reverse notation - e.g my network address is 192.168.0
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
};
And named.conf.local to named.conf
Step3:vi /etc/bind/named.conf.options
forwarders {
# Replace the address below with the address of your provider's DNS server
123.123.123.123;
};
Step4:mkdir /etc/bind/zones
Step5:vi /etc/bind/zones/example.com.db
// replace example.com with your domain name. do not forget the . after the domain name!
// Also, replace ns1 with the name of your DNS server
example.com. IN SOA ns1.example.com. admin.example.com. (
// Do not modify the following lines!
2006081401
28800
3600
604800
38400
)

// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
example.com. IN NS ns1.example.com.
example.com. IN MX 10 mta.example.com.

// Replace the IP address with the right IP addresses.
www IN A 192.168.0.2
mta IN A 192.168.0.3
ns1 IN A 192.168.0.1
Step6: vi /etc/bind/zones/rev.0.168.192.in-addr.arpa
@ IN SOA ns1.example.com. admin.example.com. (
2006081401;
28800;
604800;
604800;
86400
)

IN NS ns1.example.com.
1 IN PTR example.com
Step7: /etc/init.d/bind9 restart
Step8: change /etc/resolv.conf
search example.com
nameserver 192.168.0.1

Friday, November 2, 2007

centos 5 iptables configure

$yum install system-config-securitylevel
$system-config-securitylevel