I have read several guides about setting up a DNS server using Yast, now I am confuse, some guides use hostname in mx records and ns records, other guides uses alias, with the respective A record not been the hostname but and alias, Now, I have a DNS server with the hostname server01 with the ip address 192.168.0.10 and a router with the address 192.168.0.1, this server is also the mail server, how will be registered the NS record, and MX record and the A record in yast for this server?
I was thinking in ns record as
server01
MX record
server01 with the value of 0
and an A record
server01 A 192.168.10
this is only for learning, I am just trying to understand this.
I am setting up the DNS using Yast, so to enter those entries what I do is: in the NS Tab in yast I enter in the Ns Record field the hostname of the server, in the MX tab I enter the hostname of the server too in the address field with the priority of 10 and in the records tab I enter the A record been the record key the hostname of the server, the type A and the Value is the IP address of the server.
I mean Yast Dns setup tool tab controls, check the images to see if the values are correct, remember that the hostname of the server is server01 and its ip is 192.168.0.2, the server roles are DNS and MAIL server both in the same server.
Don’t see anything obviously wrong but screenshots are not as easy to read as the generated zone file. Though you might want a value other than 0 for the MX priority, 10 is often used. This gives you a chance to put something less than or greater than 10 for another MX.
PTR records go in the reverse zone file, which would be 0.168.192.in-addr.arpa.
Looks fine. Did you set the TTL to 15 days for the A record? That’s rather long and makes it hard to change the value quickly. For a local DNS server you can keep the value fairly low, even as low as 10 minutes, since it’s all LAN traffic.
I get this example from the Samba-3 by example book in the page 102
$ORIGIN .
$TTL 38400 ; 10 hours 40 minutes
abmas.biz IN SOA sleeth1.abmas.biz. root.abmas.biz. (
2003021833 ; serial
10800 ; refresh (3 hours)
3600 ; retry (1 hour)
604800 ; expire (1 week)
38400 ; minimum (10 hours 40 minutes)
)
NS dns.abmas.biz.
MX 10 mail.abmas.biz.
$ORIGIN abmas.biz.
sleeth1 A 192.168.1.1
sleeth2 A 192.168.2.1
qmsa A 192.168.1.20
hplj6a A 192.168.1.30
qmsf A 192.168.2.20
hplj6f A 192.168.2.30
dns CNAME sleeth1
diamond CNAME sleeth1
mail CNAME sleeth1
as you can see in this example a cname is used to set the NS and MX record, I have read in some guides that you can only use A records, is this example wrong?
A MX record may not point to a CNAME. It’s defined in RFC 2181:
10.3. MX and NS records
The domain name used as the value of a NS resource record, or part of the value of a MX resource record must not be an alias. Not only is the specification clear on this point, but using an alias in either of these positions neither works as well as might be hoped, nor well fulfills the ambition that may have led to this approach. This domain name must have as its value one or more address records. Currently those will be A records, however in the future other record types giving addressing information may be acceptable. It can also have other RRs, but never a CNAME RR.
I think the spec is clear enough. (please: nobody shall tell me it works with a CNAME. There’s a rule, and many programs may depend on it.)
Then the example of the samba book is wrong? this is why I got confused about this topic, there are different info in the different guides.
I read an example where the autor created an A record but not with the machine name but with an alias, ie. the server name was server01 with the address 192.168.0.20, so he created an A record like this.
mail1 A 192.168.1.20
and then he created a MX record like this one
MX 10 main.sienic.site.
is that right? He did the same thing for the NS record.
Note: It doesn’t matter if the real host name of the mail server is NOT “mail”. Internet hosts don’t mind that, they just need to know what’s the name of the mail server, and what’s the IP address for that name.
You can redefine a single IP to have multiple names using standard A records which is functionally the same as a CNAME for entries within a zone.
; zone fragment for example.com
$TTL 2d ; zone default = 2 days or 172800 seconds
$ORIGIN example.com.
…
server1 IN A 192.168.0.3
www IN CNAME server1
; following is functionally identical
; but incurs no CNAME lookup overhead
server1 IN A 192.168.0.3
www IN A 192.168.0.3
according to these two guides, if the name server/mail server has the hostname server01 and ip address 192.168.0.20, I can create the ns record as ns1 and the mx record as mail1 and then create their respective A records, no matter what the real hostname of the server is as long as it has an A record pointing to the correct server IP address.
for example:
sienic.site. IN NS ns1.sienic.site.
sienic.site. IN MX 10 mail1.sienic.site.
server01 IN A 192.168.0.20
ns1 IN A 192.168.0.20
mail1 IN A 192.168.0.20
In general,
This is the correct way to do this (as described by Easgs), you simply create multiple A records for the same IP address instead of CNAMES pointing to the A address.
But, I do remember vaguely the irritation and frustration I had dealing with Google’s hard-headed insistence to reject any MX pointing to a CNAME and the inability to create multiple A records with the same IP address at OpenDNS. In the end, I just changed the DNS provider. I wouldn’t expect the same problem should exist today, but it can be painful for awhile after RFCs are made official and Services are slow to react.