DNS Error accessing webserver

Hi guys, I only found out about and installed EHCP today and it looks like a brilliant app! I've almost got it working, but people outside my home network can't connect. Here's my configuration:

Wireless home network (cable modem -> D-Link wireless router, port forwarded)
Laptop (Ubuntu, Jaunty, running LAMP and EHCP)
Desktop PC (for non-hosting use, testing)
Ownership of domain piemaster.net (and drumtaboo.info) with GoDaddy.com

I followed that tutorial to set it up (went well), and I'm now running EHCP on my laptop with the domains set up. The thing is I can go to http://piemaster.net/ or http://drumtaboo.info/ in my browser and the sites work perfectly. However when people outside my home network try it, it fails to connect. EDIT: In the time I've been writing this, it no longer even works for me. See below :(.

Here's the two things I'm worried about (due to inexperience):

1. The name server setup with GoDaddy - I've read a lot of EHCP posts about this, and think I've got it right. I've registered my IP address (114.77.x.x, forwarded from my router's Virtual Server to my laptop's internal IP [192.168.0.193]) as both ns1.piemaster.net and ns2.piemaster.net, and set those name servers as the name servers for the domain. That was a couple hours ago, so it might just have not propagated yet, I'm not sure.

2. The network interface setup - the setup walkthrough said:

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.254
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

However I don't think I can just copy this format for a few reasons.
a) eth0 is my ethernet cable device afaik, and I'm using my wireless, so I put eth1 instead.
b) My network is 192.168.0.1, not .1.0 (D-Link vs Netgear I believe?), so I replaced all those 3rd-place 1's with 0's
c) Obviously the address is different, but should I leave the gateway as 192.168.0.1, or make it .1.1? Or should the network be .0.0?

3. Like I said, I've broken it for myself now too... the internal redirection USED to go from public port 8080 to local port 80, but I changed it to 80 -> 80. Then it worked for me but no one else, and I then realised I'd set up EHCP to think that the server was at 114.77.x.x:8080, so I changed it to the now correct address with no port. And now it doesn't work. The page fails to load, and Google Chrome tells me "DNS error - cannot find server".

Anyway there's no rush, but having read that can anyone suggest what course of action I can take with the best chance of success? Bear in mind it was working before I messed with the internal IP's, so the logic seems to be correct, just I've screwed up my networking somewhere.

Thank you in advance!

Just as a quick followup, I mentioned I bought both piemaster.net AND drumtaboo.info. drumtaboo.info is hosted on my laptop pretty normally - I just moved all the files into the right httpdocs directory and set GoDaddy's A record to my router's IP. The name servers are still the default GoDaddy ones. The thing is, http://drumtaboo.info/ displays exactly what it should for me, but not for those outside my home network, so the original problem still stands.

So the question is, why does http://piemaster.net/ NOT work at all, when the only difference is that it's more correct (i.e. I updated the name servers)? Presumably I messed up the name server settings somewhere. The thing is I don't want to revert the piemaster.net settings just to make it work, I would prefer to change BOTH sites to use the correct method AND work properly, but I'm not going to change drumtaboo.info's settings until I can get piemaster.net working.

Any clues?

Your isp usually blocks port 80.

Lets assume that you have that port opened.
Lets also assume that you have a static ip address.

Install ehcp and add your domain(s)
Go to godaddy, and configure the nameservers. (I forget if ehcp runs a dns server, if it doesnt you can use a service like http://freedns.afraid.org/)
All should work.
If you have any problems, i can help you out with the exact steps.

Does http://drumtaboo.info/ have a blank page as the main page?

Port 80 is open, and my laptop has a static IP.

I've installed EHCP and added both domains. I don't know exactly how EHCP works, but if it DOESN'T act as a DNS then that would explain a lot :P Nothing that talks about EHCP seems to say you need anything else (apart from LAMP stuff), so I just assumed it would work.

I'll have a look over freedns and see what happens though. Cheers!

And http://drumtaboo.info/ has all the content on it that I want since I moved all the files into its EHCP domain folder, so it's certainly not blank. It's being served correctly, as I can access it from my desktop (on the Home network). The problem certainly seems to be name servers, as that's the only thing I changed on GoDaddy between the two domain names.

EDIT: Hmm, well that's all very interesting. I signed up to Free DNS and changed my GoDaddy name servers to NS1-4.AFRAID.ORG and put the A Record for piemaster.net to my IP, but nothing's changed.

EDIT2: Running nslookup on piemaster.afraid.org (following "server ns1.afraid.org") like they suggested gave some error regarding my ISP, since I'd put my /etc/resolv.conf back how it started. Do you know what I should have written in /etc/resolv.conf? By default it's:

domain vic.optushome.com.au
search vic.optushome.com.au
nameserver 192.168.0.1

... where Optus is my ISP, but I'm pretty sure I have to change it. The nslookup error is like "server can't find piemaster.afraid.org.vic.optushome.com.au", but when I get rid of the domain line it tells me "server can't find piemaster.afraid.org: NXDOMAIN".

I will try it on my server, and list the steps here. Will post back in a few hours.

ehcp installs, configures and runs bind/named dns server by default.. no special setting required for normal dns operation, apart from adding domain to ehcp.

Didn't realize ehcp installed bind. Here are the steps to configure your dns with godaddy:

Install ehcp:
wget www.ehcp.net/download
tar -zxvf ehcp_latest.tgz
cd ehcp
./install.sh

Go to ehcp panel
Click easy add domain
Enter yourdomain.com

Log into GoDaddy
Click on Domain Manager
Click on the domain that you want to use
Look at bottom left, where it says Host Summary
Click add
Type NS1.yourdomain.com
Type in your IP where it says Host IP 1
Press ok
Click add again
Type NS2.yourdomain.com
Type in your IP where it says Host IP 1
Press ok

Under Nameservers, click Manage
Add your name servers (ns1.yourdomain.com and ns2.yourdomain.com)

Wait up to 2 days. Everything should work.

Okay, I installed it without a hitch, I added my domain (with Add, not Easy Add, but it seemed straightforward enough), and for piemaster.net I added my IP (114.77.86.29) as Host IP 1 twice as NS1 and NS2 (I only typed NS1 and NS2 in the field - it's got a ".PIEMASTER.NET" appended on the end of the field), and then put NS1.PIEMASTER.NET and NS2.PIEMASTER.NET in the Manage Name Servers window thing.

This was about a week ago, and nothing worked.

Then I had a crack with FreeDNS which all went smoothly, set my name servers to NS1-4.AFRAID.NET or ORG or whatever it was and although www.piemaster.net displays a placeholder page (since I haven't aliased it to my IP), piemaster.net (which has an A Record to my IP) fails to load. Same deal.

I've put it back to NS1 and 2.PIEMASTER.NET now, but I'm convinced the problem is on my laptop somewhere, most likely in either /etc/resolv.conf AND/OR /etc/network/interfaces. What should I have in these files?

I followed the exact steps i posted, and no problems on my end.

I think i know the problem though, when i type in your ip address, your website does not show up, telling me that you have still not fixed things on your router. What router do you have? are you sure you have a static ip address?

Okay, I feel like the world's dumbest dude right now.

Turns out I had DHCP on all along - I was so sure I had static IP's that I just ignored it. I noticed when suddenly the IP to my laptop was 192.168.0.198, instead of .193. So I switched off the DHCP server and we're full static now, laptop is 192.168.0.198. Router is a D-Link DIR-635 FYI.

Of course my IP wasn't changing from .193 before, so it's still not working. Again, it works on networked computers, but not from outside. My DNS server in /etc/resolv.conf is set to 192.168.0.1 (my router's internal IP), and I think that's right.

nmap 115.77.86.29 works (everything's open), host localhost and host 192.168.0.198 both time out (I think they're supposed to?), but host 114.77.86.29 returns some domain name pointer involving my ISP which sounds good. nslookup piemaster.net returns my IP as a non-authoritative answer which is good, I think, but both host ns1.piemaster.net and host ns1.drumtaboo.info time out. I just set my piemaster.net name servers back to ns1 and ns2.piemaster.net a few hours ago, but I haven't touched drumtaboo.info in ages. So that's probably a problem. All those tests ehcpdeveloper was doing before all seem to work though.

So feel free to yell at me for being such a dunce, but what should I try now that it's at least semi-correctly set up? Thanks you all so much for your patience btw.

A 192.168.x.y IP address is reserved for private networks and is not valid on the internet, therefore your router must be performing NAT. Your router has an address that is connected to the internet(115.77.86.29), you'll need to know what this is to get inbound access to your server.

Your server must have it's 192.168.x.y address staticly set. You'll configure your router to forward port 80 to 192.168.0.198 (or whatever your server's Ip address is). Then, from elsewhere on the internet you can enter 1.2.3.4 to connect to your server (where 1.2.3.4 is the publicly accessible IP address on your router).

To forward port 80 on your dlink dir-635:
http://portforward.com/english/routers/port_forwarding/Dlink/DIR-635/Apache.htm

I understand that 192.168.0.x is internal, and I have forwarded all the important ports (afaik), especially 80 and 53, using the D-Link Virtual Server page, which is apparently just port forwarding but for individual ports. My laptop (server) is statically assigned to 192.168.0.198 within the network, and said ports are all forwarded to 192.168.0.198. Not only that but my laptop is DMZ'd as well, so I can't think of any way to increase its availability. MAC Address filtering is off - that's correct for static IP's, right?

Anyway, the fact remains that 114.77.86.29 fails when accessed publicly, as do piemaster.net (using 114.77.86.29 as both name servers) and drumtaboo.info (using the standard GoDaddy name servers and the Total DNS tool).

i did a few checks now..
nameserver for piemaster.net is ns1.piemaster.net , this is normal, or may be like this.. I assume that your main dns domain is piemaster.net.

however, when I look for A record for piemaster.net, I cannot find any.
for test, on linux console,

# host piemaster.net
;; connection timed out; no servers could be reached

this means that your nameserver of ns1.piemaster.net is not reached through dns port of 53 somehow..

on an external (with regard to your home network) linux machine, try this:

host ns1.piemaster.net 114.77.x.x

this checks your ip, if it can handle dns requests..
or alternatively, you can:
nmap 114.77.x.x

this checks all open ports.. you should see port 20,53,80,110,143 etc. open there.. 53 is important for dns..
if it is not open, that means: you did not redirect your port 53 to your notebook..

if your external users cannot reach you, most probaly: your dns is not working from outside, somehow..
one possible reason for this: did you set ip of ns1.piemaster.net as 114.77.x.x on godaddy ? you may need to set this in godaddy.. some registrars needs this. I am not sure about godaddy.

normal behaviour for ex:

# host ehcp.net
ehcp.net has address 96.31.91.67
ehcp.net mail is handled by 10 mail.ehcp.net.
# host ns1.ehcp.net
ns1.ehcp.net has address 96.31.91.67
#

Thanks for the response, it's got me a bit closer I think.

First of all, my port 53 wasn't forwarded because I didn't know it was required. It's amazing how much assumed knowledge there is for Web hosting. I have now forwarded ports 21, 53, 80, 110 and 143 from my router to my laptop. nmap agrees. Is there any others I should have open?

Regarding the A record, there WAS a section of the GoDaddy interface called Total DNS which let me set A Records and all kinds of things. However it was only available when I was using the default GoDaddy namespaces - since I told it the site was hosted externally, I can't access the Total DNS thing anymore. Should I be setting A Records on my laptop somewhere? Do I really need to if the connection has already made it to my laptop?

I checked the name servers I registered (ns1.piemaster.net and ns2.piemaster.net), and both point to 114.77.86.29, my router's IP address (I saw other people putting .x.x, but I don't really see the point anymore :P). If my router is set up to forward port 53 to my laptop's port 53, that should be all good, right?

Of course having done all this, it's still not working. So it's clearly a DNS setup problem - is there any quick ways to check for possible solutions? Like nmap - that thing is handy.

EDIT: I just noticed that there's a Dynamic DNS option on my router - could that be any help, even though my IP doesn't change unless I tell it to.

If you would follow guid on http://www.ehcp.net/helper/yardim/cats.php, you would see necessary steps for a proper hosting operation, mostly.. Networking concepts and All ports are listed in http://www.ehcp.net/helper/yardim/cat.php?cid=6

dynamic dns option of router is for non-static ips i think, in your case, your ip is static..
Go and check on links above. they are moderately good guide I think..

I suggest you to do all tests from outside your home network.. Because, your internal network has some other concerns, I will tell you later, your internal net needs some other configuration for your sites to work...
Do all type of tests (dns, website etc..) from outside of your home net... for ex, a net of your friend...

Check on your local server:
host ns1.piemaster.net localhost
this should give a reply. if not, there is something wrong with your server's dns/bind.

I checked your server/external-real ip from two different locations.
What is interesting is :
your server gave very different results:

# nmap 114.77.86.29

Starting Nmap 4.76 ( http://nmap.org ) at 2009-08-12 17:14 EEST
Note: Host seems down. If it is really up, but blocking our ping probes, try -PN
Nmap done: 1 IP address (0 hosts up) scanned in 3.21 seconds
# nmap 114.77.86.29 -P0

Starting Nmap 4.76 ( http://nmap.org ) at 2009-08-12 17:14 EEST
Interesting ports on 114.77.86.29.optusnet.com.au (114.77.86.29):
Not shown: 990 filtered ports
PORT STATE SERVICE
21/tcp open ftp
25/tcp open smtp
53/tcp open domain
80/tcp open http
110/tcp open pop3
113/tcp closed auth
119/tcp open nntp
143/tcp open imap
5050/tcp open mmcc
5190/tcp open aol

Nmap done: 1 IP address (1 host up) scanned in 12.88 seconds
# host piemaster.net 114.77.86.29
;; connection timed out; no servers could be reached
# host ns1.piemaster.net 114.77.86.29
;; connection timed out; no servers could be reached
#
#
#
#
# host ns1.piemaster.net 114.77.86.29
;; connection timed out; no servers could be reached
#
#
#
#
# nmap 114.77.86.29 -P0

Starting Nmap 4.76 ( http://nmap.org ) at 2009-08-12 17:23 EEST
Stats: 0:00:00 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
Interesting ports on 114.77.86.29.optusnet.com.au (114.77.86.29):
Not shown: 991 filtered ports
PORT STATE SERVICE
21/tcp open ftp
25/tcp open smtp
80/tcp open http
110/tcp open pop3
113/tcp closed auth
119/tcp open nntp
143/tcp open imap
5050/tcp open mmcc
5190/tcp open aol

Nmap done: 1 IP address (1 host up) scanned in 4.41 seconds
#
#
#
# nmap 114.77.86.29 -P0

Starting Nmap 4.76 ( http://nmap.org ) at 2009-08-12 17:24 EEST
Stats: 0:00:01 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 1.45% done; ETC: 17:25 (0:01:14 remaining)
Interesting ports on 114.77.86.29.optusnet.com.au (114.77.86.29):
Not shown: 998 filtered ports
PORT STATE SERVICE
25/tcp open smtp
113/tcp closed auth
Nmap done: 1 IP address (1 host up) scanned in 4.18 seconds
#
#

The meaning of those results are:
your server or network is not stable.. gives us very different results.. (or you did play with it in the time of my test).. This is really strange...
if you have a type of firewall, on your router or your server, I suggest first disabling it, that is, allow everything from outside,
then deny things one by one...

This is what I can suggest up to now..
see you.

Hi Bahattin,

Sorry, I have had my laptop turned off briefly a few times recently, which may have caused some confusion, but it's given me results like that even when I execute them on the laptop while it's running and should be working fine. I'll try and leave it on from now on.

I've DMZ'd my laptop so all those important ports are wide open. I can still access http://piemaster.net and http://drumtaboo.info AND http://114.77.86.29/ from inside my home network, but they don't connect from outside.

It's gotta be something wrong with my laptop, right? What should I have in /etc/resolv.conf and in /etc/network/interfaces?

I did a small check on your site,
I found:

# host piemaster.net
piemaster.net has address 114.77.86.29
# host www.piemaster.net
www.piemaster.net has address 67.19.72.202

This means, you did not redirect all subdomains of your piemaster.net to your server..
you should redirect all dns or all subdomains (especially www subdomain, yes, www is also a subdomain) of your domain to your ip of 114.77......

Otherwise, outside world cannot see your pages..

Another note, from outside, when anyone types: http://114.77..... they should not see your piemaster.net normally, instead, they should see default ehcp homepage.. you can change that, but default behaviour is like that.

As I see, you miss something essential, like dns redirection.
I suggest you to use your own dns (your server), to do that, redirect to your server from where you bought your domain.

I should say that, running a website is not so hard.. many people do it with little work.. just follow simple steps..

Ah right, I forgot to delete my piemaster.net domain at FreeDNS, which I've just done now. That didn't redirect the www address, but that may have been a good idea. I wasn't aware it was necessary, and I was just tying to fiddle as little as possible.

I also hadn't updated the GoDaddy name servers *facepalm* I am easily confused when doing 4 things at once. Give it all a sec to update :P

I have an Apache web server running on my machine, with a "no-ip" url at joelperl.no-ip.info. I can access the web server from any machine on the internet that I have. I told a friend to go to it, and they said it couldn't be found - DNS error - the same thing you get when you type a website in wrong. I figured maybe No-ip was down or something, so I gave him my real IP address, but the same thing happened. Along this i want to introduced some cheap linux hosting services along with the blog hosting services which are reliable and easy to use now people are going to use wordpress hosting services just because they are much reliable and you can use it at home or office equally. after this continue to previous talk, Yes, I asked him to read the IP back to me. It was typed in correctly, and no, he didn't accidentally put a www at the beginning. He could access every other site he tried, but not mine. Why?

You could try other settings, i cant really help you that much. http://www.canyouseeme.org/ is a port checker, you can try to configure your router again, and see if port 80 is still blocked....

Sorry i couldnt help you fix it.

No, thank you for helping so much. It's easy to think of a server as either working or not working, but really there's a lot of stuff you have to do to get it working, and I wouldn't be anywhere near as close as I am without the support of you guys.

I tried out your link, and it can see all my ports except 80 (!), where it says:

Error: I could not see your service on 114.77.86.29 on port (80)
Reason: No route to host

You said ISPs may block port 80, so I put my HTTP proxy port 8080 back on, forwarding to port 80, and my friend can reach http://114.77.86.29/! But not http://114.77.86.29/. The question then is how can I set http://piemaster.net/ to point at http://114.77.86.29:8080/ instead of http://114.77.86.29/? I've set it in the dnsip field of EHCP, but it hasn't fixed anything... is this another situation where I just have to wait? I can't register 114.77.86.29:8080 as a name server with GoDaddy unfortunately (because it's a port, and not a server), but it seems to be able to reach port 53 okay. Is there anything else I have to change to set make the :8080 part of piemaster.net?

EDIT: http://piemaster.net:8080/ WORKS! It's not ideal though, obviously. Is it even possible to make :8080 the default port for the domain? I would've thought that's what dnsip would do, but if it could be anything else, I'll certainly try that.

Also, I managed to lose my old .htaccess file... where should I put the new one that I'll have to write from scratch? In piemaster.net/httpdocs/?

Thanks again!

Sorry for the late reply.

There is no way to make 8080 as the default port because port 80 is used as the HTTP Server port on many browsers. You have to figure out a way to forward port 80, or tell people to go to piemaster.net:8080. (i tried to go to http://piemaster.net:8080, but it doesnt work for me.

About .htaccess, wherever the default directory is (which contains your index.html file)

Hey again, thanks for the reply.

When I said it worked it did, but then it stopped working shortly afterwards. I didn't know why, and I couldn't figure out how to deal with the :8080, AND THEN my laptop's wireless totally messed up and that was the last straw. This has been killing me for the last 2 weeks, and following the discovery of port 80 being blocked and that Optus doesn't even allow web hosting on their Personal plans anyway, I decided to close the door on web hosting for now. Sigh. It's a lot of stress I don't have to worry about anymore.

I'm hosted over at http://heliohost.org/ which is pretty much perfect for everything I wanted to do in the first place, and everything just WORKS. Welcome, everyone, to http://piemaster.net/, now with 100% less errors.

That said, I'd like to sincerely thank you both again for your extreme patience and helpfulness, and for all the work you've put into EHCP. It's clear to me now that the problem was always firmly mine and nothing to do with EHCP whatsoever, so next time I decide to try and host something, you can be sure I'll be giving EHCP another shot. I've learnt a huge amount about web hosting from this whole experience, however painful, so I can safely say it was worth it.

Cheers!
- Oliver

Your website looks very nice I like to program in java also :), may i ask why you wanted to host your own web server?

Im glad you solved all of your problems (and learned a bit in the process).

This problem may be originated by so many sources, like new XP SP3, wrong Microsoft.Net, etc, etc that I could not see any solution nearby. And I have a so tight time frame to finish this work. I have an hp laptop...HP Customer Care which provides the service related to it...
HP Customer Care