Jump to content

[SOLVED] How to redirect "example.mysite.com" to an ip address?


Recommended Posts

Since I am asking this question, I honestly don't know if it has anything to do with php...

But if I'm hosting a server on my ip, how can I set up a redirect so that rather than typing in my ip, people can connect to my server using something like "server.atomicriot.com"?


In other words, I want to do exactly what http://www.dyndns.com/ does, but using MY domain instead of theirs. If this doesn't make sense, let me know.




Link to comment
Share on other sites

Well if you got a static ip then yes it worth setting up a php server and dns properly.

but if you got a dynamic ip then forget it.

just use the dns service you have provided here as a example.

Yes; I have a static ip and a port forwarded for my server and everything. I just need to know how to be able to use a web address interchangeably with my ip.

Link to comment
Share on other sites

On your domain registrar, you will give your domain an A record. The A record is the IP address that your domain translates to. Once you have entered your static IP as the A record, then after a while of DNS refreshes through the DNS community you will be able to bring up a command prompt and do ping www.yourdomain.com it should return your static IP address as the responding address.


Your server must be set up to respond to that name. If your server is configured to respond to that name, and serve the proper content for that name and your registrar is configured with the proper A record, then voila, www.yourdomain.com gets served from your home server.


And you DON'T have to have a static IP to do this. I have used a service called ZoneEdit.com (free with limits) to handle my dynamic DNS needs. Coupled with a program called Direct Update (not free) as soon as your IP changes (configurable), it will log into zonedit.com (and many many more) for you and update your IP address. Did this for a while when I was just starting out in the big bad world of web development.  :)


Just to further clarify in case others want to try this.....


To do this with Dynamic IP, you register with ZoneEdit.com and they give you the IP address you need to use for your A record, you set that up with your registrar and then your domain name points at their system. They then push any requests for your website to your dynamic IP in real time. It would work seconds after updating the IP. Very cool service I might add.


Sort of off topic..... Direct Update is a very cool program. If you look in the program directory you will find the plain text files for all the services it works with. I was able to create a new one with a custom setup. I was then able to create some scripts to form a control panel for the company I worked for who had 60+ locations. This control panel holds the IP addresses of all the stores (scattered over 6 states), so that the IT director could have the IP address within 5 minutes of changing and remote manage the stores. Many locations had static IP's, but many did not. Direct update would call up a file on our webserver and pass the name of the store and IP into the script, the script would then update a database with the proper information. Pretty nifty setup I thought.




Link to comment
Share on other sites

I use HostMonster.

I went to the control panel and there is nothing about an "A record," but there is something about being able to purchase a "Dedicated IP Address," which would assign a unique IP to your site:


"An IP address is a number like that identifies the unique server where your website can be found. In shared hosting, you share the same IP address as other web sites on your server. By upgrading to a Dedicated IP address, you can enable your site for e-commerce and other advanced capabilities, and minimize the risk of being impacted by other sites on your shared server."


Is that what I am looking for?

Link to comment
Share on other sites

Are you wanting to host the site on your home computer?? If so they you have to contact your registrar (hostmaster) and find out from them how to change your A record.


An A Record as defined by wikipedia is:

Returns a 32-bit IPv4 address, most commonly used to map hostnames to an IP address of the host, but also used for DNSBLs, storing subnet masks in RFC 1101, etc.


If your wanting to host the site on your home PC, then the A Record needs to point to your home static IP. If your registrar is also your web host, then they will handle the A record. But either way, you have to contact them on what is what.




Link to comment
Share on other sites

Open the terminal and type:

ping server.atomicriot.com


The address resolves to, so if that's the right IP address then it works. The machine on that IP address does not respond, however.


If you don't know your home IP then you can see it at a site like whatismyip.com.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.