Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I, as many others, have dynamic DNS setup to point to my home. There are several domains directed to my house (one is spice.ignorelist.com, the other is spiceweb.ignorelist.com, which is a port redirect from :80 to spice.ignorelist.com:90)
I have so far been unable to determine why this is, but spiceweb.ignorelist.com almost always works, even when spice.ignorelist.com is not redirecting properly. Due to this, I would like to setup a simple PHP page that will fetch my external IP and display it so that I can connect remotely on ports other than 90. However, the only plausible way I have been able to think of that would do this would be something like this:
However, I have my doubts about whether this would work (if nothing else, wouldn't this leave a links session open for every time the page was accessed?). Alternatively, if you can make any suggestions as to why my dynamic DNS is not working properly, I would appreciate it, but I recognize that that question is something I should ask the owner of my nameservers. Any help would be appreciated.
Well, I had never tried to do this, but I just pointed my browser at http://whatismyip.org and got back a page with my external IP on it and nothing else. Will that do?
To be honest, this sounds more like a web server configuration problem than an IP problem. What I'm really confused about is why you have spiceweb.ignorelist.com running on port 90, when it looks to me like virtual servers would solve the problem entirely and not require a bunch of port redirections. If you could fill us in on what web server your using and how you've got it configured, we might be able to sort this out a bit.
I might not have explained this as well as I could have; whatismyip.org does show the external IP of the network accessing it, which is beautiful, exactly what I want. The problem is how to write a script that will show the IP when viewed from a webpage at my home; this way, even if my other DDNS isn't working, I can still SSH, RDC, FTP, whatever, in. spiceweb.ignorelist.com does not provide that functionality because ping/nslookup just returns the IP of the server that does the port redirect, which is not mine.
I have spiceweb.ignorelist.com on port 90 because Verizon blocks any requests coming over port 80, and unfortunately I can't come up with any way to access it through that block.
The problem is how to write a script that will show the IP when viewed from a webpage at my home; this way, even if my other DDNS isn't working, I can still SSH, RDC, FTP, whatever, in. spiceweb.ignorelist.com does not provide that functionality because ping/nslookup just returns the IP of the server that does the port redirect, which is not mine.
There is a small but fatal problem in your logic here. If your DDNS isn't working, you need to know your IP address in order to see the page that would show you your IP address. A nasty little problem. I haven't dealt with Verizon at all, but on Comcast, my IP address almost never changes. If that is also true with Verizon, you could just write down your IP address and not worry about parsing web pages.
Quote:
I have spiceweb.ignorelist.com on port 90 because Verizon blocks any requests coming over port 80, and unfortunately I can't come up with any way to access it through that block.
You can run your webserver on ports other than 80 you know. If you're using Apache, you just need to modify the Listen directive in your httpd.conf file and have it listen to whatever port you want. Then you can use virtual servers and not mess around with port redirection.
There is a small but fatal problem in your logic here. If your DDNS isn't working, you need to know your IP address in order to see the page that would show you your IP address. A nasty little problem. I haven't dealt with Verizon at all, but on Comcast, my IP address almost never changes. If that is also true with Verizon, you could just write down your IP address and not worry about parsing web pages.
I realize I'd need to know the external IP to access my site; the thing is, spiceweb.ignorelist.com always works, for reasons that I do not understand. Since the website will always load, if I can devise a way to make it show my IP, I can remotely access my IP address by any method I want and not worry whether my other DDNS service is up. I cannot do this with spiceweb.ignorelist.com because the IP of that is only the redirect server, not my home server. And unfortunately, with Verizon, my IP seems to change every other week -- otherwise I wouldn't worry about it, as you said.
Quote:
Originally Posted by Hangdog42
You can run your webserver on ports other than 80 you know. If you're using Apache, you just need to modify the Listen directive in your httpd.conf file and have it listen to whatever port you want. Then you can use virtual servers and not mess around with port redirection.
I don't need virtual servers because I only have a very few pages I'm interested in seeing, but I already modified the Listen directive to listen on port 90. I appreciate the pointer though.
dkm999, I appreciate your advice as well, but I just tried your idea and unfortunately it only displays my server's internal IP address. :-( Thank you though.
the thing is, spiceweb.ignorelist.com always works, for reasons that I do not understand.
You really should investigate what is going on with this domain, because its behavior is more than strange. If your IP address is changing on a weekly basis, then the IP associated with spiceweb.ignorelist.com must be changing with equal frequency, and something has to be doing it. Do you have an automated cron job that grabs your external IP address and updates the DNS servers? I use no-ip.com and they distribute a program that will do that. If something similar is working on your system for just spiceweb.ignorelist.com, you might be able to duplicate it for your other domains.
Quote:
I don't need virtual servers because I only have a very few pages I'm interested in seeing,
The reason I've been pushing on this is because both of your sites are based on ignorelist.com, and since spiceweb.ignorelist.com works all the time, there is no reason that spice.ignoreweb.com shouldn't work the same way unless you've done something with virtual servers that is causing the issue.
As far as grabbing the external IP address, do you know any perl or bash? Both of those would be able to do the trick of parsing the whatsmyip.com web page.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.