Notice the line with the ``MX'' in it. This is called the MX record.
mydomain.com. 14400 IN MX 0 mydomain.com.
The MX record shows that all emails @ mydomain.com should be routed to the mail server at mydomain.com. The DNS record shows that mydomain.com is located at 216.34.94.184. This means that email meant for liz@mydomain.com will be routed to the email server at 216.34.94.184. This finishes the task of the MX record. The email server on that server(say sendmail) then takes over, collects the email and then proceeds to distribute it to the user ``liz''.
It is important that there be a dot(``.'') after the domain name in the MX record. If the dot is absent, it routes to ``mydomain.com.mydomain.com''. The number 0, indicates Preferance number. Mail is always routed to the server which has the lowest Preferance number. If there is only one mail server, it is safe to mark it 0.
Multiple mail servers
Multiple email servers are useful for the sake of redundancy. If the Highest Priority email server (one with the lowest Preference number) is down, then the email is routed to the Server with the second highest Preference number.
For example
mydomain.com. 14400 IN A 216.34.94.184
server2.mydomain.com. 14400 IN A 216.34.94.185
mydomain.com. 14400 IN MX 0 mydomain.com.
mydomain.com. 14400 IN MX 30 server2.mydomain.com.
You can have unlimited MX entries for Fallback.
If all the MX records are equal Preference numbers, the client simply attempts all equal Preference servers in random order, and then goes to MX record with the next highest Preference number.
Pointing MX records to an IP
Its not possible to have an MX record pointing directly to an IP. For example 'mydomain.com. 14400 IN MX 0 216.34.94.184`` is wrong. Define an ``A Record'' first and then have the MX record pointing to it.
server2.mydomain.com. 14400 IN A 216.34.94.185
mydomain.com. 14400 IN MX 30 server2.mydomain.com.
MX records for Subdomains
A Subdomain is something like this ``Subdomain.mydomain.com''. Assume you want to send an email to liz@subdomain.mydomain.com and to capture that on another server.
mydomain.com. 14400 IN A 216.34.94.184
server2.mydomain.com. 14400 IN A 216.34.94.185
mydomain.com. 14400 IN MX 30 mydomain.com.
subdomain.mydomain.com. 14400 IN MX 30 server2.mydomain.com.
In this configuration, liz@subdomain.mydomain.com would go to 216.34.94.185 and liz@mydomain.com would go to 216.34.94.184.
Testing the MX record
Once you setup your MX record, always test it to see if it is setup correctly. You can do with tools like nslookup.
[root@localhost sangeetha]# nslookup
> set q=mx
> yahoo.com
Server: 192.168.1.1 Address: 192.168.1.1#53
Non-authoritative answer:
yahoo.com mail exchanger = 1 mx1.mail.yahoo.com.
yahoo.com mail exchanger = 1 mx2.mail.yahoo.com.
yahoo.com mail exchanger = 1 mx3.mail.yahoo.com.
yahoo.com mail exchanger = 5 mx4.mail.yahoo.com.
Authoritative answers can be found from:
yahoo.com nameserver = ns2.yahoo.com.
yahoo.com nameserver = ns3.yahoo.com.
yahoo.com nameserver = ns4.yahoo.com.
yahoo.com nameserver = ns5.yahoo.com.
yahoo.com nameserver = ns1.yahoo.com.
mx1.mail.yahoo.com internet address = 4.79.181.14
mx1.mail.yahoo.com internet address = 4.79.181.15
mx1.mail.yahoo.com internet address = 67.28.113.10
mx1.mail.yahoo.com internet address = 67.28.113.11
ns1.yahoo.com internet address = 66.218.71.63
ns2.yahoo.com internet address = 66.163.169.170
ns3.yahoo.com internet address = 217.12.4.104
ns4.yahoo.com internet address = 63.250.206.138
ns5.yahoo.com internet address = 216.109.116.17
>
How spammers read your MX
Spammers will typically target your lowest priority Email servers, in the hopes of encountering a poorly configured box. The Spam program reads the MX records, locates the Email server with the lowest Priority(highest Preference number) and attempts to spam with that server.
So it is important to equally update all your email servers with Antivirus and Antispam.
Wednesday, March 7, 2012
How to enable quotas on an ext4 file system. Centos 6 (Works with WHM
If you are receiving the following error when trying to enable quotas in WHM:
========
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option
=======
You should first try doing both of the following via SSH:
/scripts/fixquotas
/scripts/fixcommonproblems
Then try to enable quotas, if the error is still occurring you may need to edit your fstab file, this can be tricky. First you will need to run:
vi /etc/fstab
Then you will need to locate where your directories are mounted on. For example, if you have this line:
/dev/mapper/vg-root / ext4 discard,noatime 1 1
You will need to replace it with:
/dev/mapper/vg-root / ext4 discard,noatime,usrquota 1 1
You should now reboot your system and once booted go into WHM and click Enable Quotas or run:
/scripts/fixquotas
========
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option
=======
You should first try doing both of the following via SSH:
/scripts/fixquotas
/scripts/fixcommonproblems
Then try to enable quotas, if the error is still occurring you may need to edit your fstab file, this can be tricky. First you will need to run:
vi /etc/fstab
Then you will need to locate where your directories are mounted on. For example, if you have this line:
/dev/mapper/vg-root / ext4 discard,noatime 1 1
You will need to replace it with:
/dev/mapper/vg-root / ext4 discard,noatime,usrquota 1 1
You should now reboot your system and once booted go into WHM and click Enable Quotas or run:
/scripts/fixquotas
Friday, January 13, 2012
Finding bios version in linux servers
Command : dmidecode --type 0
[root@testsrv1 ~]# dmidecode --type 0
# dmidecode 2.7
SMBIOS 2.5 present.
[root@testsrv1 ~]# dmidecode --type 0
# dmidecode 2.7
SMBIOS 2.5 present.
CLEANING UP THE LINUX BUFFER CACHE
When you write data, it doesn’t necessarily get written to disk right then. The kernel maintains caches of many things, and disk data is something where a lot of work is done to keep everything fast and efficient.
That’s great for performance, but sometimes you want to know that data really has gotten to the disk drive. This could be because you want to test the performance of the drive, but could also be when you suspect a drive is malfunctioning: if you just write and read back, you’ll be reading from cache, not from actual disk platters.
Obviously the first thing you need to do is get the data in the cache sent on its way to the disk. That’s “sync”, which tells the kernel that you want the data written. But that doesn’t mean that a subsequent read comes from disk: if the requested data is still in cache, that’s where it will be fetched from. It also doesn’t necessarily mean that the kernel actually has sent the data along to the disk controller: a “sync” command is a request, not a command that says “stop everything else you are doing and write your whole buffer cache to disk right now!”. No, “sync” just means that the cache will be written, as and when the kernel has time to do so.
Note that you really didn’t even need the “sync” if this is what you are doing: the overwrite forces the sync itself.
Modern Linux kernels make this a bit easier: in /proc/sys/vm/ you’ll find “drop_caches”.
You can simply echo a number to that to free caches.
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
That’s great for performance, but sometimes you want to know that data really has gotten to the disk drive. This could be because you want to test the performance of the drive, but could also be when you suspect a drive is malfunctioning: if you just write and read back, you’ll be reading from cache, not from actual disk platters.
Obviously the first thing you need to do is get the data in the cache sent on its way to the disk. That’s “sync”, which tells the kernel that you want the data written. But that doesn’t mean that a subsequent read comes from disk: if the requested data is still in cache, that’s where it will be fetched from. It also doesn’t necessarily mean that the kernel actually has sent the data along to the disk controller: a “sync” command is a request, not a command that says “stop everything else you are doing and write your whole buffer cache to disk right now!”. No, “sync” just means that the cache will be written, as and when the kernel has time to do so.
Note that you really didn’t even need the “sync” if this is what you are doing: the overwrite forces the sync itself.
Modern Linux kernels make this a bit easier: in /proc/sys/vm/ you’ll find “drop_caches”.
You can simply echo a number to that to free caches.
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
clear swap space in linux
There have been times where it has been necessary for UNIX Admins to clear out the swap space on a Linux system. In order to do this, you must first make sure that you have enough free memory to hold what is being used by swap.
First we want to see what is currently being used.
free
Then I run the actual commands that empty the swap:
swapoff -a and then swapon -a
Then I check what is being used after doing this.
free
First we want to see what is currently being used.
free
Then I run the actual commands that empty the swap:
swapoff -a and then swapon -a
Then I check what is being used after doing this.
free
To check the login attempts to see if it needs to be reset
To check the login attempts to see if it needs to be reset type faillog -u
root@testsrv:~ # faillog -u user1
Username Failures Maximum Latest
user1 15 0
Reset the counter with the -r flag:
root@testsrv:~ # /usr/bin/faillog -r user1
Username Failures Maximum Latest
user1 0 0
root@testsrv:~ # faillog -u user1
Username Failures Maximum Latest
user1 15 0
Reset the counter with the -r flag:
root@testsrv:~ # /usr/bin/faillog -r user1
Username Failures Maximum Latest
user1 0 0
Difference between ext3 and ext4
Features
1. Ext3 stands for third extended file system.
Ext4 stands for fourth extended file system.
Introduced
2. ext3 was introduced in 2001.
ext4 was introduced in 2008.
3. Kernel Support
ext3 Supports from Linux Kernel 2.4.15
ext4 Supports from Linux Kernel 2.6.19
4. Maximum individual file size supported
ext3 Maximum individual file size can be from 16 GB to 2 TB
ext4 Maximum individual file size can be from 16 GB to 16 TB
5. Maximum file system size supported
Overall ext3 file system size can be from 2 TB to 32 TB
Overall maximum ext4 file system size is 1 EB (exabyte).
1 EB = 1024 PB (petabyte).
1 PB = 1024 TB (terabyte).
6. Maximum sub directories
ext3 Directory can contain a maximum of 32,000 subdirectories
ext4 Directory can contain a maximum of 64,000 subdirectories
Other Features
The main benefit of ext3 is that it allows journaling.
Journaling has a dedicated area in the file system, where all the changes are tracked. When the system crashes, the possibility of file system corruption is less because of journaling.
There are three types of journaling available in ext3 file system.
Journal – Metadata and content are saved in the journal.
Ordered – Only metadata is saved in the journal. Metadata are journaled only after writing the content to disk. This is the default.
Writeback – Only metadata is saved in the journal. Metadata might be journaled either before or after the content is written to the disk.
In ext4, it supports journaling and also has the option of turning the journaling feature “off”.
Several other new features are introduced in ext4: multi block allocation, delayed allocation, Journal checksum, fast fsck and etc.
All you need to know is that these new features have improved the performance and reliability of the file system when compared to ext3.
Supports huge individual file size and overall file system size.
You convert ext2 to ext3 without having any data loss
You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it).
1. Ext3 stands for third extended file system.
Ext4 stands for fourth extended file system.
Introduced
2. ext3 was introduced in 2001.
ext4 was introduced in 2008.
3. Kernel Support
ext3 Supports from Linux Kernel 2.4.15
ext4 Supports from Linux Kernel 2.6.19
4. Maximum individual file size supported
ext3 Maximum individual file size can be from 16 GB to 2 TB
ext4 Maximum individual file size can be from 16 GB to 16 TB
5. Maximum file system size supported
Overall ext3 file system size can be from 2 TB to 32 TB
Overall maximum ext4 file system size is 1 EB (exabyte).
1 EB = 1024 PB (petabyte).
1 PB = 1024 TB (terabyte).
6. Maximum sub directories
ext3 Directory can contain a maximum of 32,000 subdirectories
ext4 Directory can contain a maximum of 64,000 subdirectories
Other Features
The main benefit of ext3 is that it allows journaling.
Journaling has a dedicated area in the file system, where all the changes are tracked. When the system crashes, the possibility of file system corruption is less because of journaling.
There are three types of journaling available in ext3 file system.
Journal – Metadata and content are saved in the journal.
Ordered – Only metadata is saved in the journal. Metadata are journaled only after writing the content to disk. This is the default.
Writeback – Only metadata is saved in the journal. Metadata might be journaled either before or after the content is written to the disk.
In ext4, it supports journaling and also has the option of turning the journaling feature “off”.
Several other new features are introduced in ext4: multi block allocation, delayed allocation, Journal checksum, fast fsck and etc.
All you need to know is that these new features have improved the performance and reliability of the file system when compared to ext3.
Supports huge individual file size and overall file system size.
You convert ext2 to ext3 without having any data loss
You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it).
Subscribe to:
Posts (Atom)