How to setup mx record for subdomain?

Questions of the day ?

How to setup a MX domain for ?

We just now edit zone file /var/named/master/db.domeniuro

$TTL 300

@ 1d IN SOA (
2016090701 ;Serial
10800 ;Refresh after 3 hours
3600 ;Retry after 1 hour
1209600 ;Expire after 1 week
86400 ) ;Minimum TTL of 1 day

;———————–___ Name Servers ____—————————-

1d IN NS
1d IN NS
1d IN MX 5
1d IN MX 10
1d IN TXT “v=spf1 a mx ptr -all”

;———————–___ Aliases___________—————————-

mail IN A
mail2 IN A

subdomeniu  IN  A

;———- MX Subdomeni —————-
subdomeniu IN MX 5
subdomeniu IN MX 20


How we test if we setup right MX ?

[root@mail7 ~]# host -t mx mail is handled by 20 mail is handled by 5

DNS Server ISP Romania.


Mai jos pun lista de servere DNS oferite de fiecare Internet Service Provider (ISP) din Romania:
Voi trece în dreptul fiecarui IP și ce Reverse DNS are fiecare. Daca nu are se trece none.

  1.  DNS Telekom – – – –
  2. DNS RDS – – – –   –   –
  3. DNS Vodafone – –  –  none  –  none
  4. DNS Orange  –  –  –  –
  5. DNS UPC, Astral  –   –   –  –   –  –  –  –  –
  6. DNS INES    –   NS-1.iNES.RO  –   NS-2.iNES.RO
  7. DNS Nextgen  –    –
  8. DNS Primetelecom  –  –


DNS gratuit avem o lista scurta de Google și OpenDNS:

    1. Google   –   –
    2. OpenDNS  –  –
    3. DNS gratuit de la    – no revers DNS     – no revers DNS
    4. DNS gratuit de la IBM quad9 –

UPDATE: 04.12.2017

Scopul acestei postari este doar personal și voi face update periodic.

How to Clone a PostgreSQL database!

At some point in development, you may want to make a copy of your existing development database to play with an unstable new feature. Postgres makes it super trivial to do that by allow us to create a new database by using existing database as a template.

In postgres console, run

=# CREATE DATABASE new_database_name WITH TEMPLATE original_database_name;

Boom!, you got a cloned database named new_database_name.

Credit: Creating a copy of a database in Postgres
I’ve seen a convenient way to make a clone across remote server too. (Haven’t try) How to copy postgres database to another server

Easy step.
Instead of running command in psql, we can use createdb with -T flag like so

$ createdb -T original_database_name new_database_name


How to fix auto-read-only mdadm.

This guide shows you a simple way to fix your mdadm raid based drives which are not syncing or in the auto-read-only mode.

To find the names of your drives which are under auto-read-only mode or not syncing

cat /proc/mdstat

Force the drives to sync.

mdadm --readwrite /dev/md9

Replace md9 with the name of the drive like md127 etc.
server ~ # cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] [linear] [multipath]
md125 : active (auto-read-only) raid1 sda1[0] sdb1[1]
      192640 blocks [2/2] [UU]

md126 : active raid1 sda5[0] sdb5[1]
      97650944 blocks [2/2] [UU]

md127 : active raid1 sdb2[1] sda2[0]
      97659008 blocks [2/2] [UU]
      [=>...................]  resync =  8.8% (8686848/97659008) finish=64.0min speed=23148K/sec

md128 : active (auto-read-only) raid1 sdb6[1] sda6[0]
      288875200 blocks [2/2] [UU]

Source Info:

CP: max source files number arguments for copy utility


Today we have a problem: We get this error when we try to copy over 32356 file in other folder.
[root@mail]# cp -p office_23\* office\
-bash: /bin/cp: Argument list too long

Solutions: run your command in a loop.

[root@mail]# for file in office_23\*; do cp -p “$file” office\; done

And works very well.

Roundcubemail change default format for date_short

If you want to change time show for mail in roundcubemail you need to do next:

[root@mail ~]# grep date_short /var/www/html/roundcubemail/config/
//$config['date_short'] = 'D H:i';
$config['date_short'] = 'd-m-Y H:i';

But no effect ? Go to Settings —–> Preferences —-> User Interfaces and uncheck “Pretty Dates” like picture below.

Roundcubemail date format

Could not reliably determine the server’s fully qualified domain name Ubuntu?

If you get next error:

Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using for ServerName
... waiting apache2:
Could not reliably determine the server's fully qualified domain name, using for ServerName

vi  /etc/apache2/conf.d/fqdn
or vi  /etc/apache2/conf-available/fqdn.conf  ( for Ubuntu 14.04 )
 a2enconf fqdn

Ubuntu server 12.04 LTS with GUI and xRDP.

Some people like GUI interface and some steps show here.

First step is to go comand line interface:

sudo apt-get update
sudo apt-get install ubuntu-desktop

install Gnome 
apt-get install gnome-shell

and reboot

After reboot we need to install xRDP

apt-get install xrdp

root@server-ubuntu-12:~# sysv-rc-conf --list | grep xrdp
xrdp 0:off 1:off 2:on 3:on 4:on 5:on 6:off