I have installed XAMPP, and my projects are saved in htdocs folder. When I view it in browser the URL identifies as
How can I access it using a domain name of my choice, such as ?
My computer runs Windows 7, and I plan to access this website from my computer only (not across the web).
44 Answers
You need to add a host to your hosts file.
Open a command shell and type the following command.
echo "127.0.0.1 " >> %SYSTEMROOT%\System32\drivers\etc\hostsYou can test that this command has worked by cracking open a command shell and entering the following command:
ping This will confirm that you the host entry for is located at 127.0.0.1. If you see an IP address that isn't 127.0.0.1 then the previous step did not complete correctly.
You will also need to edit your httpd.conf file and modify the the Virtual host section to include the following line:
ServerAlias Once your have made this change restart Apache. You will then be able to browse to ""
8As I understand you want use a domain name on your local work. In that case you can edit your hosts file.
127.0.0.1 If you really want host your own site, you can use a dyndns subdomain and a cname forward from your domain control panel (if you haven't got a static IP address).
What you want to do is make your computer a NameServer ? Or you just want to forward a domain to the ip of your computer ?
You can forward the domain you purchased to the ip of your computer, make sure you have static ip (verify with internet service provider)
For practice, i would start playing with dynamic dns to figure how it works before pointing a REAL domain to your computer.
Link:
1LifeHacker has got a few articles related to this.
See this :
1Step 1. Set up your DynDNS.com account.
Register for a free account at DynDNS. Agree to the site's terms, and use a legitimate email address to complete registration. Once in awhile, DynDNS will email you at that address asking you to confirm that it continue your service.
Log into your new account. Go to the "My Services" area on the left side. Under "Host Level Services" click "Add Host Services." There, click "Add Dynamic DNS Host." DynDNS will autofill your IP address (if you're doing this from your home computer). Choose a domain and type in a custom subdomain, which can be anything from lifehacker.kicks-ass.org or john.is-a-geek.com or gtrapani.dyndns.org, like below:
Step 2. Set up your computer to update DynDNS.
Now that your computer is registered with DynDNS, each time your computer's IP address changes, it has to let DynDNS know. This can be done either with free updater client software or through your router.
If your computer is connected directly to the Internet, download the DynDNS updater client for Mac or Windows here. Install and enter your DynDNS information so that your computer can update DynDNS's database regularly.
If you are behind a router, you're in luck. Most modern routers support dynamic DNS services. Here's a screenshot from my router's interface (yours will look different) for with DynDNS settings:
Step 3. You're done. Give your new domain a spin!
Type your new domain name by entering it in your web browser's address bar. It should resolve to your home server. From here you can publicize or bookmark your server's new domain name no matter how often your IP address changes.
Notes: DynDNS has a few advanced options to consider.
"Enable wildcard" lets you set up sub-subdomains. For example, blog.johnsmith.mine.nu can resolve to a weblog, where jukebox.johnsmith.mine.nu can resolve to a music directory. Virtual hosts must be configured for your Apache web server to display the right site when addressed by different subdomains. Set up an MX record to handle email handling to your home server. Upgrade your account assign a custom domain name or your choosing to your home server as well, for about 25 bucks a year. See more info on Custom DNS.