Showing posts with label CentOS 5. Show all posts
Showing posts with label CentOS 5. Show all posts

Installing DNS server on CentOS 5

1 comments
In the first time, you must download core software of this service, that are

  1. bind

  2. caching-nameserver

  3. bind-chroot


You can download this software by this command,

# yum -y install bind caching-nameserver bind-chroot

After you downloaded , you can setup follow this instruction :

1. Check your hostname by this command :

# uname -n
dns.aoddy.com

2. Edit /etc/named.conf

options {
directory “/var/named”;
forwarders {WWW.XXX.YYY.ZZZ;}; // IP of ISP // query-source address * port 53;
allow-query { localhost; 192.168.0.0/24;};
// query range
allow-transfer { localhost; 192.168.0.0/24;};
// transfer range
allow-recursion { localhost; 192.168.0.0/24;};
// recursion range
};controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};// here is the section for internal informationsview “internal” {
match-clients {
localhost;
192.168.0.0/24;
}; zone “.” IN {
type hint;
file “named.ca”;
}; zone “mysite.com” IN {
// for common resolving
type master;
file “mysite.com.fwd”;
allow-update { none; };
}; zone “0.168.192.in-addr.arpa” IN {
// for reverse resolving *note
type master;
file “mysite.com.rev”;
allow-update { none; };
}; zone “localdomain” IN {
type master;
file “localdomain.zone”;
allow-update { none; };
};


zone “localhost” IN {
type master;
file “localhost.zone”;
allow-update { none; };
};


zone “0.0.127.in-addr.arpa” IN {
type master;
file “named.local”;
allow-update { none; };
};


zone “255.in-addr.arpa” IN {
type master;
file “named.broadcast”;
allow-update { none; };
};


zone “0.in-addr.arpa” IN {
type master;
file “named.zero”;
allow-update { none; };
};


};


// here is the section for external informations
view “external” {
match-clients {
any;
};


zone “.” IN {
type hint;
file “named.ca”;
};


zone “server-linux.info” IN {
// for common resolvin
type master;
file “server-linux.info.wan”;
allow-update { none; };


};


zone “80.0.16.172.in-addr.arpa” IN {
// for reverse resolving *note
type master;
file “80.0.16.172.db”;
allow-update { none; };
};
};
include “/etc/rndc.key”;


2. Create /var/named/mysite.com.fwd

$TTL 86400
@ IN SOA dns.mysite.com. root.aoddy.com.(
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS dns.mysite.com.
IN MX 10 dns.mysite.com.
IN MX 20 web.mysite.com.
IN A 192.168.0.2
dns IN A 192.168.0.2
web IN A 192.168.0.3


3. Create file /var/named/aoddy.com.rev

$TTL 86400
@ IN SOA dns.aoddy.com. root.mysite.com.(
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS dns.aoddy.com.
IN MX 10 dns.mysite.com.
IN MX 20 web.mysite.com
IN PTR dns.mysite.com.
2 IN PTR dns.mysite.com.
3 IN PTR web.mysite.com.


4. Start service

# service named restart

5. Test this server can resolve domain&ip

[root@dns named]# nslookup
> dns.mysite.com
Server: 192.168.0.2
Address: 192.168.0.2#53Name: dns.mysite.com
Address: 192.168.0.2> 192.168.0.2
Server: 192.168.0.2
Address: 192.168.0.2#53


2.0.168.192.in-addr.arpa name = dns.mysite.com.
>


6. If your service can’t resolve , you can check on your file config by this command :

# named-checkconf

Accessing cPanel Through A Firewall

0 comments

There’s been a long-standing issue from a hosting provider’s point of where cPanel runs on abnormal ports, causing users behind firewalls to be unable to access cPanel. At first, there was cpanelproxy.net which offered (at that time) an automated script that users could install on their hosting accounts to route cPanel traffic over port 80. Around the time that cPanel 11 came out, the script no longer worked, and users behind corporate or school firewalls were out of luck.
cPanel 11 introduced its own proxy to allow users to get around firewall restrictions.
To enable this feature without inconveniencing users, check these three options in WHM > Tweak Settings:
Add proxy VirtualHost to httpd.conf to automatically redirect unconfigured cpanel, webmail, webdisk and whm subdomains to the correct port (requires mod_rewrite and mod_proxy)
Automatically create cpanel, webmail, webdisk and whm proxy subdomain DNS entries for new accounts. When this is initially enabled it will add appropriate proxy subdomain DNS entries to all existing accounts. (Use /scripts/proxydomains to reconfigure the DNS entries manually)
Allow users to create cpanel, webmail, webdisk and whm subdomains that override automatically generated proxy subdomains
*Keep in mind that if you’re establishing these settings on an existing server, it’s going to update the zones for each domain on the server and synchronize them out to the DNS cluster. This got us in trouble once, as we had a number of suspended accounts on a server that ended up having their DNS reverted back when the proxy subdomains were updated.
To enable proxydomains for the whole server:
/scripts/proxydomains add
To enable for all domains on one user’s account:
/scripts/proxydomains –user=<user> add
To enable for a single domain:
/scripts/proxydomains –domain=<domain> add
To remove proxy domains, use the same commands as above, only use “remove” instead of “add”. From here, you can access the proxy at http://cpanel.domain.com (or webmail/whm, respectively), or access cPanel normally and let it detect whether you are behind a firewall.