Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i'm running an ubuntu vps which hosts at least 2 different sites/domains via apache2's virtualhost, and they've been working fine for months. now i'm wondering about setting up some subdomains, and utilising email for the current domains i host.

i've read through posts and articles about setting up bind9, and even articles about how email actually works and it's journey from MTA to MTA( theres more to just clicking 'Send'), but my understanding is still a bit flaky here.

one of my questions is: linearly speaking, if i set up a sub-domain/sub-zone with my BIND9, assuming that it's currently installed but not running( no bind9 or named processes shown), will the bind9-DNS sever sit between my vps service provider's nameservers and my apache2-HTTP server?

example: [ns1.serviceprovider.com] > [BIND9 DNS server] > [Apache2] > [sub.mydomain.com]

and not only do i have to create records for the new sub-domain/sub-zone, but also the necessary records for all of my current domains too?

my other question is: i know email is working on my server, as i can check and send via mail, but email both to and from outside the server doesn't( i assume it's only local mail for now).i did a dig mydowmain.com MX and it shows there is a MX record pointing to my servers ip, so why do i not receive an email i sent to postmaster@mydomain.com?

the user 'postmaster' doesn't exist, but in the aliases file it shows postmaster: root.

i appreciate any help you guys can give, and i know these questions seem a little noob, but we all started out as noobs at some point ;)

share|improve this question

1 Answer 1

I am not sure you need to set up bind at all. Not sure if you want to do this as a learning exercise or not but if not, I would suggest you just set up you subdomain and hosts in your current zone at the service provider. You should be able to create the subdomain up there and not have to worry about it if you do not have experience with bind. It would just be: [ns1.serviceprovider.com]->[mydomain.com]->[sub.mydomain.com] > [Apache2]->[vhost]

As for the e-mail. You probably do not have mail listening for external connections. If you look at /etc/mail/sendmail.mc there should be a line that looks like this: DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA') You will want to remove the Addr=127.0.0.1 to tell sendmail to listen on all interfaces (If you have multiple IP's you can also just list a specific IP address if you only want it to listen on a specific IP). Once you edit the file, exit your editor and run make. Then, restart sendmail. I would really recommended reading up on sendmail and bind before starting this work (or hiring a contractor). Opening up these services to the world without knowing exactly what you are doing can lead to large security holes in your system. Not to mention that you can break things :-).

share|improve this answer
    
ah, i should have made mention that i'm using postfix, but the config file main.cf reflects similar settings, and wouldn't removing the Addr and leaving it empty turn your server into an open relay? –  xVagabondx May 25 '11 at 1:14
    
as for setting up sub-domains, my vps control panel doesn't offer a means for creating sub-domains or even domain email. strange, i know. like i said, just some things i'm a little flaky on ;) –  xVagabondx May 25 '11 at 1:22
    
Recent versions of Sendmail disable relaying by default but you should always verify the settings in your .mc before activating the changes. Sendmail.org has great online documentation. –  Chris May 28 '11 at 14:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.