How to setup “Response Policy Zone” in Bind 9.

Hello,
Today we show how to setup Response Policy Zone for bind. This works for bind 9.8.0 an newer.

# vim /etc/named.conf

and add this line:

 response-policy { zone "rpz.ceae.info"; };

now we have to declare zone

# vim /etc/named.rfc1912.zones

add

 ## RPZ Ceae Zone ##
zone "rpz.ceae.info" IN {
        type master;
        file "rpz.db";
        allow-query { any; };
};

Now we have to create rpz.db

# vim /var/named/rpz.db

and add

$TTL 1D
@       IN SOA  rpz.ceae.info. root.ceae.info. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
@       IN      NS      rpz.ceae.info.
@       IN      A       82.16.185.188

facebook.com    IN      CNAME   redirected.ceae.info.
www.facebook.com        IN      CNAME   redirected.ceae.info.
ro-ro.facebook.com      IN      CNAME   redirected.ceae.info.
twitter.com     IN      CNAME   redirected.ceae.info.
www.twitter.com IN      CNAME   redirected.ceae.info.
www.linkedin.com        IN      CNAME   redirected.ceae.info.
linkedin.com    IN      CNAME   redirected.ceae.info.

And now restart service

systemctl restart named

Info: http://www.zytrax.com/books/dns/ch7/rpz.html

Centos 7 update php from 5.4.16 to 5.6.3

Hello,

Update for today on php.

  1. rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
  2. Secons, uninstall your php ( rpm -qa |grep php )
    yum erase php-5.4.16 php-tidy php-cli php-process php-odbc php-soap php-imap php-pear php-xmlrpc php-mcrypt php-common php-pdo php-devel php-xml php-gd php-mysql php-mbstring php-mssql php-ldap php-snmp
  3. Install new php
    yum install php56w php56w-opcache
    yum install php56w-mbstring php56w-cli php56w-common php56w-gd php56w-intl php56w-mcrypt php56w-pdo php56w-pear php56w-mysql php56w-process php56w-snmp php56w-soap php56w-tidy php56w-xmlphp56w-ldap php56w-pecl-geoip

End, use : systemctl restart httpd   or  /etc/init.d/httpd restart.
Source: https://webtatic.com/packages/php56/

 

 

Postfix reject mail from unknown IP

Q:  How to reject mails from unknown IP with Postfix ?

A:  Use  reject_unknown_reverse_client_hostname in you postfix config file.

Ex: vim /etc/postfix/main.cf

smtpd_recipient_restrictions =………………. , reject_unknown_reverse_client_hostname, ……..

smtpd_client_restrictions = hash:/etc/postfix/access, permit_mynetworks, permit_sasl_authenticated, reject_unknown_reverse_client_hostname, reject_rbl_client …………………………….

Info link: http://www.postfix.org/postconf.5.html#reject_unknown_reverse_client_hostname

How to add .htpasswd for Apache

  1. Suppose we have mod_rewrite activated in Apache

First step create a file .htaccess in you folder

vim /var/www/html/website/.htaccess
and add this

AuthUserFile /var/www/html/website/.htpasswd
AuthGroupFile /dev/null
AuthName "Please Enter Password"
AuthType Basic
Require valid-user

Now we add user in .htpasswd

htpasswd /var/www/html/website/.htpasswd  useracces

Enjoy !

How to Forwarding a message with attachments in Mutt?

Q: How to Forwarding a message with attachments in Mutt?

Answer: type v to get to the attachments screen. Type t repeatedly to tag all the attachments, including the initial small text/plain attachment (that’s the original message body). When they’re all tagged, type ;f (forward all tagged attachments). After you fill in the To: prompt, you’ll be able to edit the message body, and when you leave the editor, you’ll have the attachment list there to edit as you see fit.

How to change debian root password.

How to change debian root password.
I want to change root password in Debian.
I will show you few steps to change root password.

Step 1. On grub-boot prompt press “e” to enter edit mode.
Step 2. Then press downarrow to reach the line that starts with “kernel“
press “e” again or go to end of this line with “kernel“ line.
Step 3. At the end of this line type in “init=/bin/bash” or “/bin/sh”.
Step 4. Then press enter to make that change and press “b” to boot or it is new type CTRL + X to boot.
Step 5. Now you have prompt “#”, now you have to remount partition /
mount -o remount rw /
Step 6. Now you can change root password with passwd ot whatever you want.
For restart type “init 6? or “reboot”.