LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack Search this Thread
Old 12-29-2007, 12:19 AM   #1
bikebefast
LQ Newbie
 
Registered: Dec 2007
Posts: 26

Rep: Reputation: 15
DNS query


i need to know how to put cname entries in DNS and i have a subdomain also.can anyone tell me explain how to work.
 
Old 12-29-2007, 12:54 AM   #2
thedonkdonk
Member
 
Registered: Oct 2005
Location: San Antonio, TX
Distribution: Fedora 15, RHEL 6, CentOS 6, Debian 5, Arch, Gentoo
Posts: 136

Rep: Reputation: 16
What DNS program are you using?

I am using bind 9. My zone file looks like this:
Code:
$ORIGIN thedonkdonk.net.
$TTL 86400
@     IN     SOA    dns1.thedonkdonk.net.     root.thedonkdonk.net. (
                    2007120501 ; serial
                    21600      ; refresh after 6 hours
                    3600       ; retry after 1 hour
                    604800     ; expire after 1 week
                    86400 )    ; minimum TTL of 1 day

      IN     NS     dns1.thedonkdonk.net.
      IN     NS     dns2.thedonkdonk.net.

      IN     MX     10     mail.thedonkdonk.net.
thedonkdonk.net. IN TXT "v=spf1 a mx ~all"

             IN     A       198.247.173.246

donklin01    IN     A       198.247.173.246
donklin02    IN     A       24.163.161.133
dns1         IN     A       198.247.173.246
dns2         IN     A       24.163.161.133
mail         IN     A       198.247.173.246

ftp          IN     CNAME   donklin01
www          IN     CNAME   donklin01
Notice that the CNAME record points to an A record. If you have questions about what I did just ask.

Thanks,
James Glenn
www.thedonkdonk.net
 
Old 12-29-2007, 06:14 AM   #3
bikebefast
LQ Newbie
 
Registered: Dec 2007
Posts: 26

Original Poster
Rep: Reputation: 15
$TTL 86400
@ IN SOA ns1.indyablog.com. root.ns1.indyablog.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns1.indyablog.com.
IN NS ns2.indyablog.com.
IN MX 10 mail.indyablog.com.

IN A 192.168.1.231

ns1 IN A 192.168.1.231
ns2 IN A 192.168.1.231
mail IN A 192.168.1.231
bigboy IN A 192.168.1.231
mail IN MX 10 mail.indyablog.com.


i have done this ,is it correct.
 
Old 12-29-2007, 06:22 AM   #4
bikebefast
LQ Newbie
 
Registered: Dec 2007
Posts: 26

Original Poster
Rep: Reputation: 15
my cname is indyablog.com

subdomain is mail.indyablog.com

my ip is 192.168.1.231

everything is in my localmachine.

the thing is if i type http://220.227.28.84 its resolving if i type http://mail.indyablog.com means its not coming,can u tell me y?
 
Old 12-29-2007, 08:24 AM   #5
bikebefast
LQ Newbie
 
Registered: Dec 2007
Posts: 26

Original Poster
Rep: Reputation: 15
I need to put reverse DNS entries also.But i think its working fine.coz with IP its resolving but if i give the domain name its not able to resolve.kindly help me as soon as possible.
 
Old 12-29-2007, 11:06 AM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,099

Rep: Reputation: 47
You have major problems with your zone file. You have 2 versions of mail, you have IN statements where they don't belong, and beyond all that, nobody in the world can connect to a 192.168.X.Y address, except people on the same LAN. You will receive NO mail from the outside world, nor can anyone reach your nameservers. You also cannot do the reverse address you are talking about. In most parts of the world, you need a full class C (256 addresses) to do reverse mappings.

Here is how your zone file should look, and replace the 192.168.1.231 addresses with the real public IP for your server.

The serial should be in the form yyyymmddXX, not some random small number.

Quote:
my cname is indyablog.com
No it isn't, that is your domain name. You don't have a CNAME defined anywhere.

Code:
$TTL 86400
@ IN SOA ns1.indyablog.com. root.ns1.indyablog.com. (
2007122900 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

NS ns1.indyablog.com.
NS ns2.indyablog.com.
MX 10 mail.indyablog.com.

A 192.168.1.231

ns1 A 192.168.1.231
ns2 A 192.168.1.231
mail A 192.168.1.231
bigboy A 192.168.1.231
Peace,
JimBass
 
Old 12-29-2007, 11:25 AM   #7
thedonkdonk
Member
 
Registered: Oct 2005
Location: San Antonio, TX
Distribution: Fedora 15, RHEL 6, CentOS 6, Debian 5, Arch, Gentoo
Posts: 136

Rep: Reputation: 16
Quote:
Originally Posted by JimBass View Post
... replace the 192.168.1.231 addresses with the real public IP for your server.
Assuming your public IP address is 220.227.28.84 your zone file should look like:
Code:
$ORIGIN indyablog.com.
$TTL 86400
@ IN SOA ns1.indyablog.com. root.ns1.indyablog.com. (
2007122900 ; serial YYYYMMDD## changed by d. adams
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns1.indyablog.com.
IN NS ns2.indyablog.com.
IN MX 10 mail.indyablog.com.

IN A 220.227.28.84

ns1 A 220.227.28.84
ns2 A 220.227.28.84 ; this should really be on a separate class C address
mail A 220.227.28.84
bigboy A 220.227.28.84
At least thats how I would write it for bind 9. I am sure there are other ways.
Also, a reverse address or PTR record need to be done by the company that owns the IP address. Again, if your public IP address is 220.227.28.84 then you need to contact Reliance Communications Ltd. according to the whois information. They have a listed email address of ISM.Helpdesk@relianceada.com and a telephone number of +91-22-30339595. I hope this helps.

Thanks,
James Glenn
www.thedonkdonk.net
 
Old 12-30-2007, 09:51 PM   #8
bikebefast
LQ Newbie
 
Registered: Dec 2007
Posts: 26

Original Poster
Rep: Reputation: 15
$TTL 86400
@ IN SOA ns1.indyablog.com. root.ns1.indyablog.com. (
42 ; serial YYYYMMDD
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns1.indyablog.com.
IN NS ns2.indyablog.com.
IN MX 10 mail.indyablog.com.

IN A 220.227.28.84

ns1 IN A 220.227.28.84
ns2 IN A 220.227.28.84
mail IN A 220.227.28.84
bigboy IN A 220.227.28.84


I have changed like this as you mentioned, 220.227.28.84 is NAT to 192.168.1.231, do u want my system ip to change to public ip or i can use the same.

After changing to public ip in the zone files also im not able to get mails frm outside world.Note: i have changed the zone files just now.
whether any time of 24 hrs needed.Thanks for ur reply before.Im waiting for ur reply.
 
Old 12-30-2007, 09:54 PM   #9
thedonkdonk
Member
 
Registered: Oct 2005
Location: San Antonio, TX
Distribution: Fedora 15, RHEL 6, CentOS 6, Debian 5, Arch, Gentoo
Posts: 136

Rep: Reputation: 16
Dont change the system IP. Did you make sure to increment the serial number? 42 is the same one you had before. It should be something like 2007123000.
 
Old 12-30-2007, 09:56 PM   #10
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,099

Rep: Reputation: 47
CHANGE YOUR SERIAL NUMBER!!!!!

You absolutely have to increase your serial number any time you change the file. And the number 42 is no good, the "correct" format as determined by ISC is yyyymmddxx, so the change you just made (assuming you're around GMT +3 or so) should be 2007123100.

So make the serial 2007123100, and either use rndc reload or restart the BIND service to have the changes take effect immediately.

And no, you have no need to change the IP of the system, having the LAN IP of 192.168.1.231 is fine for the server, but nobody else in the world can reach it at that address. You publish the WAN address, the LAN address is unimportant to the world.

Peace,
JimBass
 
Old 12-30-2007, 10:11 PM   #11
bikebefast
LQ Newbie
 
Registered: Dec 2007
Posts: 26

Original Poster
Rep: Reputation: 15
Thanks Jim & Donk.I have made the changes as u mentioned.

My http file look like this:
----------------------------

servername indyablog.com
NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>



<VirtualHost *:80>
# ServerAdmin mani@mail.indyablog.com
ServerName www.indyablog.com
DocumentRoot /home/site
# ServerName indyacricket.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>


<VirtualHost *:80>
# ServerAdmin mani@mail.indyablog.com
DocumentRoot /var/www/html/squirrelmail-1.4.13
1002,1 99%


/etc/resolv.conf
-----------------

search indyablog.com
search mail.indyablog.com
nameserver 202.138.96.2
nameserver 202.138.96.3
nameserver 202.138.96.47
nameserver 202.138.96.46
~


/etc/sysconfig/network
-------------------------

NETWORKING=yes
HOSTNAME=bigboy.indyablog.com
GATEWAY=192.168.1.254
~

My hostname is bigboy.indyablog.com

Y im providing this is,still im not able to get www.mail.indyablog.com from outside.

Help me.
 
Old 12-30-2007, 10:13 PM   #12
bikebefast
LQ Newbie
 
Registered: Dec 2007
Posts: 26

Original Poster
Rep: Reputation: 15
<VirtualHost *:80>
# ServerAdmin mani@mail.indyablog.com
DocumentRoot /var/www/html/squirrelmail-1.4.13
ServerName mail.indyablog.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
 
Old 12-30-2007, 10:25 PM   #13
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,099

Rep: Reputation: 47
First off, this should be a new thread. By asking unrelated questions, you're muddying the waters for people searching for answers after you.

The problem is you have no way for apache to know what it should send people to. You have wildcards (*) for both sites, so it has no way to match a client looking for mail vs a client looking for the blog.

It has been a long time since I worked with apache1, apache2 is the default standard now, but if memory serves, making this change to the mail virtual host should do the job:

Code:
<VirtualHost *:80>
# ServerAdmin mani@mail.indyablog.com
ServerName www.indyablog.com
DocumentRoot /home/site
# ServerName indyacricket.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

<VirtualHost mail*:80>
# ServerAdmin mani@mail.indyablog.com
DocumentRoot /var/www/html/squirrelmail-1.4.13
ServerName mail.indyablog.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
And you should log access and error messages for the mail site as well. Point them at a different log file from the main site, so they get logged separately.

Peace,
JimBass
 
Old 12-30-2007, 10:43 PM   #14
bikebefast
LQ Newbie
 
Registered: Dec 2007
Posts: 26

Original Poster
Rep: Reputation: 15
I didnt get u.Plz explain me.
 
Old 12-30-2007, 11:07 PM   #15
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,099

Rep: Reputation: 47
You have 2 virtual hosts run by Apache, the www.indyablog.com and mail.indyablog.com. When you have virtual hosts, apache needs some way to tell them apart. The 2 ways are either having them on separate IP addresses, or by using names. Since you're running on one IP, you have to use names so apache knows whether to send a client to the indyablog.com site or the mail.indyablog.com site.

In your configuration, you have both sites listed as *:80. That means anything making contact on port 80. How can apache know to send somebody to the mail site if you identify mail the same way you identify the indyablog.com? Very simply, it can't. It will always send clients to the first match, which is the indyablog.com site. To get to mail, you need to change the httpd.conf as I showed above, making the virtual host directive look for "<VirtualHost mail*:80>". That means if the client asks for mail.indyablog.com, it will go to the mail site, and if it asks for anything but mail, it will go to indyablog.com.

Peace,
JimBass
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query regarding DNS saini_mw Linux - Software 4 09-14-2009 12:29 PM
DNS query sanw2k Linux - Networking 1 03-11-2005 11:31 PM
DNS query chynna_v Linux - Newbie 1 09-15-2004 04:57 AM
DNS query for all Domains dominant Linux - Networking 2 04-05-2004 11:24 AM
DNS Query Attack?? Manuel-H Linux - General 0 04-06-2003 09:00 PM


All times are GMT -5. The time now is 05:25 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration