Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mail domain only :)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
JarekG
Apprentice
Apprentice


Joined: 26 Jan 2005
Posts: 160
Location: Poland | Birmingham [UK]

PostPosted: Sat Feb 14, 2009 12:32 am    Post subject: Mail domain only :) Reply with quote

Hi,

I've got a server with public static IP. On that server I host a few domains. I would like to do something like that... separate one of that domains as just only a mail domain. My question is how to do it ? Very probably is to set in a proper way DNS. But question is ... how ? ;).

I will develope it more for you.

Example.

I've got a domain somedomain.com. And I want to set that domain as a mail domain only. So... if somebody puts as an URL somedomain.com I want him to get an error message "Sorry domain not found" or something like that... but... if somebody will send an email to user@somedomain.com that email will be delivered.

I wonder wheateher that what I want to do is generally possible. I could achieve it by removing "A" record from DNS and leave just only "IN MX" record.... but I'm not sure wheather it will work... honestly I don`t think so. I think it's impossible to do such kind of thing I want to do. But maybe I'm wrong. Anyway in relating to apache, I can just only create an alias or redirection and if somebody put somedomain.com as URL then server will redirect it to properdomain.com. I see just only that solution.

I wonder what do you think about it :).

Please share with your experience.

Regards,

Jarek
_________________
Pozdrawiam
Jarosław Grząbel
HERE I AM
Back to top
View user's profile Send private message
doctork
Guru
Guru


Joined: 25 Apr 2004
Posts: 370
Location: Cleveland, OH

PostPosted: Sat Feb 14, 2009 2:07 am    Post subject: Reply with quote

This is straight forward DNS stuff. You need something with an A record:

someserver.somedomain.com. A 1.2.3.4

and an MX record

mail.somedomain.com MX 10 someserver.somedomain.com.

Of course, someserver.somedomain.com should not accept HTML requests for somedomain.com.

doc
Back to top
View user's profile Send private message
JarekG
Apprentice
Apprentice


Joined: 26 Jan 2005
Posts: 160
Location: Poland | Birmingham [UK]

PostPosted: Sat Feb 14, 2009 9:49 am    Post subject: Reply with quote

doctork wrote:
This is straight forward DNS stuff. You need something with an A record:

someserver.somedomain.com. A 1.2.3.4

and an MX record

mail.somedomain.com MX 10 someserver.somedomain.com.

Of course, someserver.somedomain.com should not accept HTML requests for somedomain.com.

doc


I agree with you, but it's not what I wanted to do.

In your case you want me to create SUBDOMAIN, and it is some kind of solution but it doesn`t satisfy me. I don't want to create subdomain.

Now I have an idea. Maybe I have my apache misconfigured ? Maybe it's easier. I have my virtual hosts configured as NameVirtualHost *:80.
This is my virtual host file.

Code:
<VirtualHost XXX.XXX.XXX.XXX>
 ServerName somedomain.com
 ServerAlias www.somedomain.com
 DocumentRoot /www/somedomain.com/
     <Directory "/www/somedomain.com">
     Options None
     AllowOverride Options
     Order allow,deny
     Allow from all
     </Directory>
</VirtualHost>


where XXX.XXX.XXX.XXX is my IP.

As a reminder... I host couple of domains on one the same IP, every domain responds in a good way, because of apache configuration. One domain isn`t included to apache configuration, that's why it shows blank screen (exaclty the same if you put IP address), but I don`t want that domain to show anything.

Am I thinking to much ? :).
_________________
Pozdrawiam
Jarosław Grząbel
HERE I AM
Back to top
View user's profile Send private message
doctork
Guru
Guru


Joined: 25 Apr 2004
Posts: 370
Location: Cleveland, OH

PostPosted: Sat Feb 14, 2009 3:29 pm    Post subject: Reply with quote

Well no, my suggestion doesn't create any subdomain. It just defines a server within somedomain.com and points to it as the mail exchange for somedomain.com. DNS neither knows no cares about apache or any other web server. If DNS returns the address of your server, it's up to your server application whether it responds to any requests on the address.

doc
Back to top
View user's profile Send private message
JarekG
Apprentice
Apprentice


Joined: 26 Jan 2005
Posts: 160
Location: Poland | Birmingham [UK]

PostPosted: Sat Feb 14, 2009 5:15 pm    Post subject: Reply with quote

doctork wrote:
Well no, my suggestion doesn't create any subdomain. It just defines a server within somedomain.com and points to it as the mail exchange for somedomain.com. DNS neither knows no cares about apache or any other web server. If DNS returns the address of your server, it's up to your server application whether it responds to any requests on the address.

doc


Hmm.. I think I get it now.

So basicly ... it's a domain somedomain.com. I need to configure it silmiar as below (exluding soa and other things):

Code:

@                       IN      NS              any.dns.server.com.
something.mydomain.com MX      10   mydomain.com.
something.mydomain.com IN A      XXX.XXX.XXX.XXX


You think that in this case named will not return any error about that zone ? I think it will because it can ignore mydomain.com as an out-of-zone entry, doesn`t it ?
_________________
Pozdrawiam
Jarosław Grząbel
HERE I AM
Back to top
View user's profile Send private message
doctork
Guru
Guru


Joined: 25 Apr 2004
Posts: 370
Location: Cleveland, OH

PostPosted: Sat Feb 14, 2009 5:52 pm    Post subject: Reply with quote

I'm sorry, I was wrong.

I expect what you want is:

Code:

@     IN   A   xxx.xxx.xxx.xxx   (you probably already have this)
@     MX  10  mydomain.com.


or if you want to give your mail server a different name (not necessarily a different IP):

Code:

@    MX 10 mailserver.mydomain.com.
mailserver.mydomain.com.   IN  A  xxx.xxx.xxx.xxx


Note that the "IN" is optional. Also note the "." following "mydomain.com" It's not optional.

doc
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Sun Feb 15, 2009 8:51 pm    Post subject: Reply with quote

Yes, it's possible, I've seen it before (though never configured it myself before). Just remove all DNS entries for that domain other than the MX records.
_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
Tekeli Li
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2009
Posts: 95

PostPosted: Sun Feb 15, 2009 10:34 pm    Post subject: Re: Mail domain only :) Reply with quote

JarekG wrote:

I've got a domain somedomain.com. And I want to set that domain as a mail domain only. So... if somebody puts as an URL somedomain.com I want him to get an error message "Sorry domain not found" or something like that... but... if somebody will send an email to user@somedomain.com that email will be delivered.


Then all you need to do is to ensure that only mail service is available on the machine to which somedomain.com points to (A record). You don't need MX record at all, unless you want to redirect mail name requests from one domain to another, usually subdomain.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum