Solved

DNS Quickie

Posted on 2000-03-22
10
208 Views
Last Modified: 2010-03-18
How do I make it so that the address mydomain.com maps to my www.mydomain.com.  Right now I have all of my services (mail, www, ns, ftp) run off the same computer, and my SOA looks like this:
<PRE>
@    IN    SOA    mydomain.com.  hostmaster.mydomain.com
</PRE>

and I also have the A record:
<PRE>
mydomain.com.  A  my.ip.add.here
</PRE>

Any help would be appreciated.
0
Comment
Question by:slyph
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 1

Expert Comment

by:dserna
ID: 2646706
I an doing the same exact thing that you are doing with my domain. One machine does everything. To point mydomain.com to www.mydomain.com, here is the way you do it. In you zone file for mydomain.com you add an "A" record for your domain:

mydomain.com.      IN      A      123.123.123.123

That's all you do and just do an ndc reload so that you DNS server picks up the change.

Hope that helps.

0
 

Author Comment

by:slyph
ID: 2646769
I tried that and it didn't work ... I think I already had and A record for my domain, except that it didn't have the 'IN' in front of it.  I printed my zone file below, perhaps it will help:

@       IN      SOA     mydomain.com. hostmaster.mydomain.com. (
                        1997022700 ; Serial
                        28800      ; Refresh
                        14400      ; Retry
                        3600000    ; Expire
                        86400 )    ; Minimum
;
                TXT     "My Domain"
                NS      goddessnet.net.         ; Namesever
                NS      ns.other.com.
                MX      10 mydomain.com.      ; Primary Mailserver
;              

localhost       A       127.0.0.1

mydomain.com.   A       123.123.123.123
ns1             A       123.123.123.123
mail            A       123.123.123.123
www             A       123.123.123.123


Thanks.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2646826
Uhh, your zone file is basically bogus. There should be only one host "A" record and CNAME records for it's aliases. If you name the machine ns1.mydomain.com in it's host file, the zone file should look like:

$ORIGIN mydomain.com.
ns1      IN A       1.2.3.4.1
mail      IN CNAME ns1.mydomain.com.
www      IN CNAME ns1.mydomain.com.

And the reverse zone file should look like:

$ORIGIN 4.3.2.1
1       IN PTR ns1.mydomain.com.

There's an excellent tool for checking the sanity of a dns setup called nslint, which you can get from ftp://ftp.ee.lbl.gov/nslint.tar.Z.

0
 

Author Comment

by:slyph
ID: 2646879
As to the CNAME issue, what I have works, expcept for the www thing.  Anyway, I was adhering to the argument made in the DNS HowTo, more specifically at http://www.linuxdoc.org/HOWTO/DNS-HOWTO-4.html :

It's also safe to assume that a CNAME is not a legal host name for a e-mail address: webmaster@www.linux.bogus is an illegal e-mail address given the setup above. You can expect quite a few mail admins Out There to enforce this rule even if it works for you. The way to avoid this is to use A records (and perhaps some others too, like a MX record) instead:

www             A       192.168.196.2

A number of the arch-bind-wizards, recommend not using CNAME at all. But the discussion of why or why not is beyond this HOWTO.


Oh, a little sidenote, the goddessnet.net. in my zone file as the name server above should be mydomain.com.

0
 
LVL 1

Expert Comment

by:dserna
ID: 2646885
I an doing the same exact thing that you are doing with my domain. One machine does everything. To point mydomain.com to www.mydomain.com, here is the way you do it. In you zone file for mydomain.com you add an "A" record for your domain:

mydomain.com.      IN      A      123.123.123.123

That's all you do and just do an ndc reload so that you DNS server picks up the change.

Hope that helps.

0
Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

 

Author Comment

by:slyph
ID: 2646892
As to the CNAME issue, what I have works, expcept for the www thing.  Anyway, I was adhering to the argument made in the DNS HowTo, more specifically at http://www.linuxdoc.org/HOWTO/DNS-HOWTO-4.html :

It's also safe to assume that a CNAME is not a legal host name for a e-mail address: webmaster@www.linux.bogus is an illegal e-mail address given the setup above. You can expect quite a few mail admins Out There to enforce this rule even if it works for you. The way to avoid this is to use A records (and perhaps some others too, like a MX record) instead:

www             A       192.168.196.2

A number of the arch-bind-wizards, recommend not using CNAME at all. But the discussion of why or why not is beyond this HOWTO.


Oh, a little sidenote, the goddessnet.net. in my zone file as the name server above should be mydomain.com.

0
 

Author Comment

by:slyph
ID: 2646894
I told you, I already did that and it didn't work.
0
 

Expert Comment

by:AGB
ID: 2668986
You can insert proper CNAME (Canonical Name) records for all your services only.

For example:

ftp IN CNAME mydomain.com.
www IN CNAME mydomain.com.
mail IN CNAME mydomain.com.
ns IN CNAME mydomain.com.

This records use for aliases.

It may be:

ns IN CNAME mydomain.com.
www IN CNAME ns

0
 
LVL 2

Expert Comment

by:pheur
ID: 2693060
This is how my zone files look like when created.
(well, this is adapted to your needs). If you want to avoid CNAMEs this is the way to do it. More mail exchangers, more MX lines/host....

@  IN  SOA mydomain.com. hostmaster.mydomain.com. (
      2000040701 10800 3600 86400 86400
      )

      IN NS      ns1
      IN NS      ns2
      IN A      123.123.123.123
      IN MX      5  mail

WWW      IN A      123.123.123.123
WWW      IN MX      5 mail
FTP      IN A      123.123.123.123
FTP      IN MX      5 mail
Mail      IN A      123.123.123.123
Mail      IN MX      5 mail
0
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
ID: 2693174
Yeah, but that's still in violation of the RFC because there are multiple A records for the IP.

There's nothing inheritly wrong with using CNAME's, if you do it correctly. That means that for every CNAME'd host that you want email delivered to, you've also created an MX record. The problem comes about from paranoid mailers that do a double lookup on the target system. They lookup the IP and then do a reverse lookup on that IP. In the case of a CNAME'd host the FQDN returned won't be the same as the target FQDN. Using an MX record side-steps that problem. Mailers are required to honor the MX record and the target of the MX host has matching A & PTR records.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now