LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Newbie: DNS, Port Forward, web and email hosting (https://www.linuxquestions.org/questions/linux-newbie-8/newbie-dns-port-forward-web-and-email-hosting-4175499871/)

Tapash 03-29-2014 05:52 AM

Newbie: DNS, Port Forward, web and email hosting
 
Hi All
I am having hard time figuring this out. Sorry if its vary basic question for some of you, but i am just learning all these stuff now..
First thing first, i bought a domain name example.com from godaddy.
I have centos 6 server setup at home, IP 192.168.1.45
External IP for the router 66.77.88.99
Now i want to setup Bind Dns server on my Centos to resolve the name example.com
  • if I setup bind on my centos server do i need to do a port forwarding on my router to redirect the incoming traffic on the example.com?
  • when i setup dns do i need to use the name server that was provided by godaddy?

At this point i am using DNS A record on godaddy to redirect the traffic to my external Ip, and portforwarded to my centos server.

joe_2000 03-29-2014 11:45 AM

Quote:

Originally Posted by Tapash (Post 5143212)
Hi All
I am having hard time figuring this out. Sorry if its vary basic question for some of you, but i am just learning all these stuff now..
First thing first, i bought a domain name example.com from godaddy.
I have centos 6 server setup at home, IP 192.168.1.45
External IP for the router 66.77.88.99
Now i want to setup Bind Dns server on my Centos to resolve the name example.com
  • if I setup bind on my centos server do i need to do a port forwarding on my router to redirect the incoming traffic on the example.com?
  • when i setup dns do i need to use the name server that was provided by godaddy?

At this point i am using DNS A record on godaddy to redirect the traffic to my external Ip, and portforwarded to my centos server.


You need to make sure that traffic coming to your router is being forwarded to your Cent OS machine. That means , you need to forward port 80 (and 443 if you intend to use https) to IP 192.168.1.45. (Make sure that internal IP is static!)
Next, you need to make sure example.com is being resolved to your public ip. If you have a static external ip (which you probably don't), GoDaddy can do that for you. If you have a dynamic ip, you need to use a dynamic dns service. If your package at godaddy supports dynamic dns, you could use e.g. ddclient to take care of the update...

Bind is quite complicated to set up, and probably way more than you need.

Some routers will also support dynamic dns. If yours does, you don't even have to deal with that on the cent os machine.

Tapash 03-29-2014 12:05 PM

Quote:

Originally Posted by joe_2000 (Post 5143312)
You need to make sure that traffic coming to your router is being forwarded to your Cent OS machine. That means , you need to forward port 80 (and 443 if you intend to use https) to IP 192.168.1.45. (Make sure that internal IP is static!)
Next, you need to make sure example.com is being resolved to your public ip. If you have a static external ip (which you probably don't), GoDaddy can do that for you. If you have a dynamic ip, you need to use a dynamic dns service. If your package at godaddy supports dynamic dns, you could use e.g. ddclient to take care of the update...

Bind is quite complicated to set up, and probably way more than you need.

Some routers will also support dynamic dns. If yours does, you don't even have to deal with that on the cent os machine.

Many Thanks for reply :) I have set it up exactly the way you have explained.

Also Yes, I have Static external IP. At this moment I am using godaddy DNS A record to redirect the traffic to my external IP.

But the problem I am having when I try to setup A mail server. I am using iRedmail. I can send email. but I do not receive any email if thet email is replied.

I have MX Record setup (mail.example.com) on godaddy DNS. I looked on the internet where experts are saying proper DNS server needs to setup to make a proper mailserver.... Thats why I was thinking to setup BIND....

If you have any suggestion would be much appreciated...

Rawcous 03-29-2014 05:31 PM

Hello Tapash,

I run 2 Centos 6.5 Servers from home - 1. FTP Server, 2. Mail & Web Server with port forwarding setup for ports 20-21 for the FTP server, and ports 110 (POP) and 25 (SMTP). In this type of setup a BIND server is not required and you'll simply end up complicating things for the sake of it.

Not knowing anything about iRedmail i'm not aware of whether it's a combined SMTP / POP agent or simply used as an SMTP MTA (Mail Transfer Agent). Personally I use Sendmail for SMTP and Dovecot for POP.

You mentioned that if someone replies to an email you have sent you do not receive it, so what happens if a user attempts to send you a brand new email rather than replying to an existing email they have received - I am assuming that you do not receive that either...?

Regarding you not receiving incoming emails:

1. Have you correctly set up port forwarding via your router for both SMTP and POP ports?
2. Ask someone to send you an email, and check your log files for error messages occurring around that time - Sendmail / Dovecot typically use /var/log/maillog - not sure about iRedmail
3. Is it possible your Centos firewall is blocking incoming mail (POP) on port 110..?

Regards,

Rawcous!

descendant_command 03-29-2014 05:39 PM

Quote:

Originally Posted by Tapash (Post 5143321)
I have MX Record setup (mail.example.com) on godaddy DNS.

You also need an A record for mail.example.com.

Forget setting up BIND - just use Godaddy's DNS server.

Tapash 03-31-2014 01:31 PM

Quote:

Originally Posted by Rawcous (Post 5143436)
Hello Tapash,

I run 2 Centos 6.5 Servers from home - 1. FTP Server, 2. Mail & Web Server with port forwarding setup for ports 20-21 for the FTP server, and ports 110 (POP) and 25 (SMTP). In this type of setup a BIND server is not required and you'll simply end up complicating things for the sake of it.

Not knowing anything about iRedmail i'm not aware of whether it's a combined SMTP / POP agent or simply used as an SMTP MTA (Mail Transfer Agent). Personally I use Sendmail for SMTP and Dovecot for POP.

You mentioned that if someone replies to an email you have sent you do not receive it, so what happens if a user attempts to send you a brand new email rather than replying to an existing email they have received - I am assuming that you do not receive that either...?

Regarding you not receiving incoming emails:

1. Have you correctly set up port forwarding via your router for both SMTP and POP ports?
2. Ask someone to send you an email, and check your log files for error messages occurring around that time - Sendmail / Dovecot typically use /var/log/maillog - not sure about iRedmail
3. Is it possible your Centos firewall is blocking incoming mail (POP) on port 110..?

Regards,

Rawcous!

Thank you very much for your input. Do you mind sharing your configuration files please?

Rawcous 03-31-2014 03:10 PM

Quote:

Thank you very much for your input. Do you mind sharing your configuration files please?
Hello,

I don't mind assisting but I am not going to to simply hand over my config files without seeing some input from you, i.e:

1. The steps you have taken yourself.
2. What research have you done.
3. Errors received.

Also, I previously indicated that you should check your log files for any possible errors that you may be receiving when someone replies / sends you an email. Have you done this? Have you checked for the existence of the log file /var/log/maillog? If this does not exist then maybe the contents of /var/log/messages or an alternative iRedmail log file. As mentioned I use sendmail / dovecot for handling smtp / pop traffic - thus the config files as they stand cannot be imported into iRedmail.

Also as indicated a couple of times on here the use of BIND for your needs is overkill - As I have mentioned I run 2 personal servers without the use of bind simply by correctly setting up port forwarding via my router.

Regards,

Rawcous!


All times are GMT -5. The time now is 03:53 AM.