How to stop my website directly running from my IP address?

JoeTaxpayer

Member
Registered
Joined
Sep 6, 2016
Messages
46
Points
0
I bought an IP address and assigned it to my website on my hosting server. The website is running based on this new IP but the problem is when I type my IP address on web browser then it is pointing to my website. I only want to visit my website from my domain, not from IP address. How can I change that?
 

HostYourNet-DR

Well-known member
Registered
Joined
Jan 13, 2017
Messages
139
Points
18
If you putting the IP address in then it will always resolve to that IP address.

You need to change the main DNS record for your domain to repoint to the new IP address.

This can be done at the site of who holds your domain.
 

JoeTaxpayer

Member
Registered
Joined
Sep 6, 2016
Messages
46
Points
0
If you putting the IP address in then it will always resolve to that IP address.

You need to change the main DNS record for your domain to repoint to the new IP address.

This can be done at the site of who holds your domain.
Can you give me an example to point DNS record for my domain?
I heard setting up a vhost in apacha config fire could solve the problem but not sure what to do.

looks like the IP is dedicated to the website and hence the issue , what control panel you are using on this server or is it a plane server ?
Yeh it is a dedicated IP that assigned to the website. I bought a Directadmin license from my hosting provider and setting up my website on this panel.
 

HostYourNet-DR

Well-known member
Registered
Joined
Jan 13, 2017
Messages
139
Points
18
IF you site is setup using DNS and not IP address then all you need to do is change your main domains ip address.
hostyournet.co.uk. - 78.129.191.69

That is the layout from Cpanel. Domain holder should be the simpler if not the same.
 

rankmyhub

Well-known member
Registered
Joined
Feb 14, 2017
Messages
193
Points
18
I am not sure how to do it on directadmin, but here is what you do at domain registrar.

You need to setup A records that point the ip to domain name

example:

google.com 8.8.8.8
www.google.com 8.8.8.8

or else you can use cname

www @

where as @ is FQDN (fully qualified domain name). here google.com is FQDN.

Once you have setup your domain name to point to IP address, it will work with domain name. However, as it is dedicated IP. People will be still able to access using IP address as well. But, that should not be an issue. I think, you brought dedicated IP for a specific purpose or reason.

Hope this may help you. Thank you
 

radwebhosting

Well-known member
Hosting Provider
Registered
Joined
Jan 14, 2016
Messages
315
Points
28
Surprisingly, none of this information provided by hosting providers is correct.

Change the Reverse DNS for your IP address to something other than your domain. This will ensure that the IP does not point to your website.
 

JoeTaxpayer

Member
Registered
Joined
Sep 6, 2016
Messages
46
Points
0
JoeTaxpayer
I don't think this can work

I have an IP address and it is being used for my whole server and hosting control panel there.

My IP (IP1) --> My hosting panel
I bought the second IP (IP2) address and using it for a website that hosted on my server
I faced this issue when typing IP2 on web browser, it is redirecting to my website.
 

Collabora

Well-known member
Registered
Joined
Jan 24, 2017
Messages
123
Points
18
I bought an IP address and assigned it to my website on my hosting server. The website is running based on this new IP but the problem is when I type my IP address on web browser then it is pointing to my website. I only want to visit my website from my domain, not from IP address. How can I change that?
Just copy this into bottom of httpd.conf (usually located at /etc/httpd/conf)

Code:
<VirtualHost *:80>
ServerName localhost
Redirect 403 /
UseCanonicalName Off
UserDir disabled
</VirtualHost>

<VirtualHost *:80>
ServerName www.example.com
DocumentRoot /var/www/html
</VirtualHost>
Note: This won't work with ssl
 
Newer Threads
Replies
11
Views
4,912
Replies
7
Views
6,514
Replies
0
Views
1,387
Replies
0
Views
1,714
Latest Threads
Replies
1
Views
16
Replies
0
Views
28
Replies
0
Views
47
Recommended Threads
Replies
2
Views
2,419
Replies
0
Views
1,714
Replies
3
Views
2,168
Similar Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top