Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed in re-directing ports 80and 25

Status
Not open for further replies.

usalabs3

Technical User
Sep 7, 2004
152
US
I would like to run an email server and a web server, but my isp is blocking port 80 inbound, and port 25 inbound and outbound, is there a way that I could redirect port 25 requests to another port? and also how do I redirect port 80 inbound requests to another port?, so that when someone types in my web address using port 80, the request gets redirected to another port, then that port then directs the outgoing back to port 80, so that the user can access the website. outgoing on port 80 in no problem.
 
The only way to make non port 80 requests inbound is to either run all SSL web sites ( or, run on a different port but then the user would have to use that port when connecting to your site, ie.


As for SMTP, you can't change the port. Inbound connections from other servers will always be on port 25.

If your ISP doesn't allow you to run web and mail servers then just don't to it! Is it worth loosing your account over?

Chris.

**********************
Chris A.C, CCNA, CCSA
**********************
 
I have figured out a way to redirect port 80, using a dns service, so that my web address gets redirected to the port that my webserver is running on, invisible to the user.

As for redirecting port 25, someone suggested I use an smtp relay service.which would recieve emails sent to my domain on port 25, then direct them to my mail server host name on a different port, and yes, I would risk my account, because I believe that what I do with my service that I pay for, should be upto me, as long as I don't exceed their system bandwidth, or do anything that's illegal.
 
Or break thier Terms & Condiditions of service!

How do you plan to use DNS to redirect web traffic? DNS doesn't specify port number.

Chris.

**********************
Chris A.C, CCNA, CCSA
**********************
 
I use a service very similar to dyndns.org, all I have to do is create an A record for ww4.mydomain.com to point to my ip address, then create a subdomain, which points to ww4.mydomain.com:port EG. A record = ww4.mydomain.com, subdomain = ww4.mydomain.com:port, simple

I've just checked their terms of service, there is nothing in the terms to say that a customer cannot run a web server, the reason they block inbound port 80 is to prevent customers from using a high volume-of-traffic webserver that would exceed their bandwidth.
 
'A' records do not give port numbers. DNS is only concerned with resolving hosts and IP addsses. You cannot define a port number on an 'A' record. It will just be an illegal Resource Record and will not be loaded to the zone.

Chris.

**********************
Chris A.C, CCNA, CCSA
**********************
 
ChrisAC.

I've successfully done it, tested it, and my webserver can be accessed by anyone, bypassing port 80 at the ISP.
 
What's the URL? I'd be interested to see how the DNS is set up.

Chris.

**********************
Chris A.C, CCNA, CCSA
**********************
 
first register free at then add your domain name (mydomain.com)to it, this will give you 2 dns url's, insert them into your dns server entries at your domain registrar, then wait a few days for the change at your registrar to take affect, then log in at zonedit, then edit your domain settings, create an A record ww4.mydomain.com, then create a web forward, that points to ww4.mydomain.com, EG. with the destination of ww4.mydomain.com:port this will ensure that any get forwarded to ww4.mydomain.com on the port specified. A point of interest, do not create any CNAMEs.

simle.
 
Ah, having had a look at zonedit I see what you are doing. As I said, you can't specify a port in DNS but you can if you are using a HTTP or server redirect which is what they do with their WebForward service. Any requsts for your domain are directed to an external server (on port 80) and then that server does a redirect to your own server on the specified URL/port. It's very similar to how you are handling email with an external relay. In effect your server is 'hiding' behind the external server which your domain actually resolves to.

Very good ;-)

Chris.

**********************
Chris A.C, CCNA, CCSA
**********************
 
Thanks.

The only problem now, is to find out how I can do the same thing with port 25, free of course. :)

Any suggestions?
 
I found a free SMTP service at but I don't really understand it, I've created a free account, then it says to choose the type, I chose SMTP redirection (single destination), then it asks for the destination host,which I type in my email server host name, then the destination port, then I enter the 2 rollnet mail server names into the mx record in zonedit, but I have to create an A record to coincide with the mx record, but I don't know what to put in the A record.

Perhaps someone could help me on this.
 
You don't need to create an A record for MX records that are part of another zone, in fact, you can't. The MX records will be for the rollernet.us mail servers and so those hosts are resolvabe from the rollernet DNS servers, not your zone file. You would only create an A record if the MX was within your zone.

For example;

If your zone was fubar.com and you had a mail server called mail then you would create the MX record but you would also have to resolve 'mail'. In the zone for fubar.com you would have;

fubar.com IN MX mail
mail IN A 111.222.333.444

So when the MX record is resolved the A record for mail.fubar.com would be resolved from the fubar.com DNS server. However, if your MX is say mail.rollernet.us then that A record has to be resolved by the rollernet.us DNS servers. Your domain would be queried for the MX record and once an answer of mail.rollernet.us was received, the DNS server would have to look for the A record by finding out which DNS servers are authoratative for rollernet.us. The fubar.com domain would not be queried to get this answer.

Chris.



**********************
Chris A.C, CCNA, CCSA
**********************
 
ChrisAC.....

I still don't know how, without an A record that I can use something like mail.mydomain.com, the A record points to my public ip address, then the MX contains the hostname of my mail server, which in turn points to my domain name, so if I use another mx service how can I use mail.mydomain.com without an A record, no A record means no hostname.

If I can't figure this out, I'll have to ask you if you can set it all up for me?, I can give you my username and passwords, for both zonedit, and rollernet, along with my domain name and email server hostname, via email, hopefully get it working, so that my email server can recieve emails.
 
If you are using a third party mail server (rollernet.us) which is then just forwarding to your mail server, then you don't want your server in the MX records do you? If the MX record is your server then that wouldn't work because you have port 25 blocked.

Your MX record should just be that of the mail server that you are using at rollernet. Therefore the MX record will be the hostname of that server, not of your server.

Have rollernet told you what your MX record should be?

The other way of doing it would be to create an MX record using your domain name but pointing to the IP address of the rollernet mail server. So,

"then it asks for the destination host,which I type in my email server host name"

If the rollernet server is on say 11.22.33.44 then create a mail host for yourdomain.com, such as,

yourdomain.com IN MX mail.yourdomain.com

"but I have to create an A record to coincide with the mx record, but I don't know what to put in the A record"

Map the server name that you have created in your zone to the rollernet mail server.

mail.yourdomain.com IN A 11.22.33.44

So, to recap, in the yourdomain.com zone, you can either create a new host using your own domain to be an MX record which means that you then have to create an A record to resolve that and map it to the correct IP address of the mail host that will be relaying your mail, OR you can just set up your MX record to be a resolve host outside your domain, such as mailhost.rollernet.us or whatever they tell you to use.

Here's another examplem. One of the MX record for tek-tips.com is smtp-in1.nuvox.net. So, in the tek-tips zone file, there will not be an A record for smtp-in1.nuvox.net because it's not part of the tek-tips.com zone. It's part of the nuvox.net zone, who's soa is extns1.nuvox.net.

Chris.




**********************
Chris A.C, CCNA, CCSA
**********************
 
I already have mail.rollernet.us as the first mx record, and mail2.rollernet.us as the 2nd, but when I do an nslookup on mail.mydomain.com it says there's no such host
 
I have yahoo messenger, if you want to go one-on-one.
 
Why are you looking up mail.mydomain.com? This host will not exist if you haven't created it and if you are using the rollernet mail servers then you don't need it. You need to resolve the MX record for mydomain.com. Tell me what the domain is and I'll see if it's set up.

I'm off out now to test drive some cars but I'll check back later.

Chris.

**********************
Chris A.C, CCNA, CCSA
**********************
 
mail.mydomain.com is the hostname of my email server.

the domain name is tezandbabs.us, in the smtp redirection page of rollernet, it asks for 'domain name-------hostname-----destination port'

I enter tezandbabs.us as the domain name, and mail.tezandbabs.us as the host name of my email server, and port 2050 as the destination port.

Therefore, mail.tezandbabs.us has to point to my public ip address, but on the rollernet servers the host name is converted to my public ip address then the port is added.

I have setup some email accounts on my email server as postmaster@tezandbabs.us (admin account), webmaster@tezandbabs.us (standard account)

What should happen, is..... when the email address of say, postmaster@tezandbabs.us is send an email, then it gets sent on port 25 to the servers at rollernet, then their servers send the email to the correct mailbox on my mail server on port 2050, the same should happen with any email account setup on my mail server.
 
Well, tezandbabs.us is delegated to the zonedit name servers okay;
Code:
; ANSWER SECTION:
tezandbabs.us.          7200    IN      SOA     ns16.zoneedit.com. soacontact.zoneedit.com. 1107971856 14400 7200 950400 7200

;; AUTHORITY SECTION:
tezandbabs.us.          7200    IN      NS      ns16.zoneedit.com.
tezandbabs.us.          7200    IN      NS      ns8.zoneedit.com.
So, I'll dig for mail.tezandbabs.us;
Code:
chris@uranium chris]$ dig mail.tezandbabs.us

;; ANSWER SECTION:
mail.tezandbabs.us.     7103    IN      A       68.110.13.208

;; AUTHORITY SECTION:
tezandbabs.us.          7127    IN      NS      ns8.zoneedit.com.
tezandbabs.us.          7127    IN      NS      ns16.zoneedit.com.

So that looks okay! Your server resolves so the rollernet mail servers will be able to resolve mail.tezandbabs.us to forward your mail.

Your mail server is up;

Code:
[chris@uranium chris]$ telnet mail.tezandbabs.us 2050
Trying 68.110.13.208...
Connected to mail.tezandbabs.us.
Escape character is '^]'.
220 mail.tezandbabs.us ESMTP Merak 7.4.2; Thu, 10 Mar 2005 08:14:41 -0700

So, now to check your MX records;

Code:
; <<>> DiG 9.2.1 <<>> tezandbabs.us mx
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35235
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;tezandbabs.us.                 IN      MX

;; ANSWER SECTION:
tezandbabs.us.          7200    IN      MX      5 mail2.rollernet.us.
tezandbabs.us.          7200    IN      MX      0 mail.rollernet.us.

;; AUTHORITY SECTION:
tezandbabs.us.          7200    IN      NS      ns16.zoneedit.com.
tezandbabs.us.          7200    IN      NS      ns8.zoneedit.com.

Well, everything looks okay. Your MX records are in place. Your own server resolves. I can connect to the mail server.

Test email on it's way!

Chris.


**********************
Chris A.C, CCNA, CCSA
**********************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top