LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-17-2014, 09:59 AM   #1
Jason.01
LQ Newbie
 
Registered: May 2014
Posts: 7

Rep: Reputation: Disabled
How to CNAME in Bind ?


Im configuring Bind9 in my VM and im having problem creating a CNAME for SMTP and webmail which points/maps to my domain name.

In my forward zone file I have that code , witch lets me nslookup my domain but not SMTP. How do you cname this properly?

The error I get is: smtp.stylez24.com: NXDOMAIN

Quote:
; BIND data file for local loopback interface;
$TTL 604800
@ IN SOA server.stylez24.com. admin.stylez24.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;


stylez24.com. IN NS stylez24.com.
stylez24.com. IN A 192.168.10.1

@ IN A 127.0.0.1
@ IN AAAA ::1
www IN CNAME stylez24.com.
smtp IN CNAME stylez24.com.
stylez IN A 192.168.10.1
smtp IN A 192.168.10.2

IN MX 10 mail.stylez24.com.
mail IN CNAME server
 
Old 05-17-2014, 12:33 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Your zonefile is wrong.
You have both a CNAME and an A RR for smtp.stylez24.com. You should use only one (better leave the A RR)
Also the mail CNAME points to a non existent hostname. Besides that, it's advisable that MX should not be a CNAME, because some mailservers will complain.
Try the following and see if it works:
Code:
$TTL 604800
@ IN SOA server.stylez24.com. admin.stylez24.com. (
    3 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800 ) ; Negative Cache TTL
;

stylez24.com. IN NS stylez24.com.
stylez24.com. IN A 192.168.10.1

@ IN A 127.0.0.1
@ IN AAAA ::1
www IN CNAME stylez24.com.
stylez IN A 192.168.10.1
smtp IN A 192.168.10.2

IN MX 10 mail.stylez24.com.
mail IN A 192.168.10.2
 
Old 05-17-2014, 03:53 PM   #3
Jason.01
LQ Newbie
 
Registered: May 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
This does work out. But can i not point smtp to my domain or host ? does it need to have a different ip ?
 
Old 05-18-2014, 03:19 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by Jason.01 View Post
This does work out. But can i not point smtp to my domain or host ? does it need to have a different ip ?
You can point your domain and hosts to whatever IP you like. Usually the domain and the www resolve to the same IP, so you can browse to either http://domain.com and http://www.domain.com
Regarding MX, it should point to the host that is running a smtp server. Usually the smtp server is a different box from the webserver, so MX uses a different IP. If smtp and web servers run on the same box, then they both point to the same IP

Last edited by bathory; 05-18-2014 at 03:23 AM. Reason: typo
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BIND single cname to lookup through the forwarder Bullz3y3 Linux - Server 1 03-03-2012 01:39 AM
resolve cname of a cname with a bind dns server mariogarcia Linux - Networking 3 05-09-2011 07:32 AM
bind and cname skoinga Linux - Server 6 12-10-2010 09:21 AM
BIND 9 CNAME propagation issue rahmad Linux - Server 5 08-15-2008 02:35 AM
Bind CNAME Problem CleonII Linux - Software 1 11-01-2005 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration