In this activity, you will be adding mail routing to your DNS server so that mail being sent to your domain is sent to the correct server and delivered to the recipient. This activity assumes that you have mail server set up and that you have completed Activity 1 from this Lesson.
Adding Mail Routing to DNS Server:
There are only a few additions necessary to configure your DNS server to handle mail routing.
- Open the file that you edited in the last tutorial /etc/bind/db.#your_fqdn
- It may look similar to this:
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.example.com. root.example.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.example.com.
ns IN A 192.168.1.10
;also list other computers
box IN A 192.168.1.21
- You will need to add in a couple lines for mail as follows (using the domain example.com as above):
@ IN MX 10 #hostname_of_mail_server.example.com.
#hostname_of_mail_server IN A #ip_address_of_mail_server
- Remember to increase the serial number in the file any time you make a change to the file!!
- Save the file and restart BIND9 for the changes to take effect.
- Also, you will need to add an entry to the reverse DNS data file. It will look just like the other lines you have added for the other DNS entries:
#last_octet_of_IP IN PTR #hostname_of_mail_server.example.com
- Remember to increase the serial number in the file any time you make a change to the file!!
- Save the file and restart BIND9 for the changes to take effect.
Here are some tests you can try to check for working DNS:
- You can try sending mail from another computer to an email address with your FQDN, such as root@your_FQDN_here. Make sure mail is set up on your mail server and that there is an email account set up.