Archive for May, 2009

SBDavid

How to Close Open DNS Servers

How to Close Open DNS Servers

How do I check my system?
Go to www.dnsreport.com

Edit the /etc/named.conf file such.

And then look for:

key “rndckey” {
};

After this add the following, replacing mainIP and secondaryIP with your systems nameservers.

acl “trusted” {
mainIP;secondaryIP;127.0.0.1;
};

After that’s done you want to add the section that says only the trusted is allowed for certain functions. Check your options area and make sure you add the following:

allow-recursion { trusted; };
allow-notify { trusted; };
allow-transfer { trusted; };

Then Restart DNS

How to Ban an IP Address From The Server

If you are running iptables, you can enter:

iptables -A INPUT -s ipaddress -j DROP

If you have APF firewall installed

apf -d ipaddress
SBDavid

Restore off a mounted slave disk

Restore off a mounted slave disk

rsync -vrplogDtH /mnt/old/usr/local/apache/conf /usr/local/apache
rsync -vrplogDtH /mnt/old/var/named /var
rsync -vrplogDtH /mnt/old/home/* /home
rsync -vrplogDtH /mnt/old/usr/local/cpanel /usr/local
rsync -vrplogDtH /mnt/old/var/lib/mysql /var/lib
rsync -vrplogDtH /mnt/old/var/cpanel /var
rsync -vrplogDtH /mnt/old/usr/share/ssl /usr/share
rsync -vrplogDtH /mnt/old/var/ssl /var
rsync -vrplogDtH /mnt/old/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
rsync -vrplogDtH /mnt/old/var/log/bandwidth /var/log
rsync -vrplogDtH /mnt/old/usr/local/frontpage /usr/local
rsync -vrplogDtH /mnt/old/var/spool/cron /var/spool

-v, –verbose increase verbosity
-r, –recursive recurse into directories
-l, –links copy symlinks as symlinks
-o, –owner preserve owner (super-user only)
-g, –group preserve group
-D same as –devices –specials
-t, –times preserve modification times
-H, –hard-links preserve hard links

Next from : cd /mnt/old/etc

rsync -vrplogDtH secondarymx domainalias valiases vfilters exim* proftpd* pure-ftpd* passwd* group* *domain* *named* wwwacct.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddrpool* ssl /etc

Repairing MyISAM mySQL Tables and Databases:

Repairing MyISAM mySQL Tables/Databases.
Please note that we assume your mySQL data directory is /var/lib/mysql

cd /var/lib/mysql/DBNAME
myisamchk -r *.MYI
SBDavid

Fixing rndc error in WHM/cPanel

Fixing rndc error in WHM/cPanel

(ndc: connection failed: connection refused)

To get your name servers working, you will need to eliminate this error, it
is quite a simple fix and can be completed in a few minutes via the
standard cPanel /scripts

1. Login to your server as root via SSH
2. Run:

/scripts/updatenow

3. Run:

/scripts/fixndc

If not fixed then.

1. Login to your server as root via SSH
2. Run: vi /etc/rndc.conf
replace all instances of “rndc-key” with “rndckey”
3. Run: vi /etc/named.conf
replace all instances of “rndc-key” with “rndckey”
4. Run:

/scripts/fixnamed

5. Run:

/scripts/fixndc

6. If you received an error in the last step, run /scripts/fixndc another
time.
7. Restart named.

Next »