0

There may already be a question similar to this, but I do not find specific to my problem. I was given a public IP for example 10.10.10.15. After setting up DNS, I can normally access through a browser. But I still can access through a public ip.

My question is, how so that others can not access directly the public ip from browser, but the only access to the web address that has been determined?

On the server, I installed ubuntu and general settings for LAMPP.

  • As far as I know, what you are asking is not possible. DNS is merely a human-readable name that gets translated to an IP address. When you type in a domain name as a URL, it gets translated to the destination IP. That's how it works. – Aubrey Robertson Jul 23 '16 at 06:02
  • @AubreyRobertson yes I would understand it, but her question how to prevent direct access to the public ip of the browser. I'll edit my question. – Khalifa Esha Jul 23 '16 at 06:06
  • I don't understand. You cannot prevent people from accessing via the public IP address without preventing them from also accessing via the domain (web address) associated with that IP address. Are you trying to prevent people from typing in the IP and accessing the system? Or are you trying to enable the domain address? – Aubrey Robertson Jul 23 '16 at 06:10
  • @AubreyRobertson preventing people to type in the form of IP, but only in the form of address only :) – Khalifa Esha Jul 23 '16 at 06:13
  • 2
    You could set up an Apache virtual host for the IP that gives an error page but I really don't see any advantage to doing that. – Julie Pelletier Jul 23 '16 at 06:20
  • Yeah, what @JuliePelletier said. I've never heard of anyone asking for what you are asking. The whole purpose of the "form of address" (you really mean domain name) is just to make it something easy to read (instead of numbers). Domain names are merely mappings to IP addresses. If you disable the IP address, you disable the domain name. I think Julie's suggestion would only work for HTTP traffic, no? – Aubrey Robertson Jul 23 '16 at 06:23
  • @JuliePelletier can you explain why there is no advantage? – Khalifa Esha Jul 23 '16 at 06:24
  • @AubreyRobertson: Yes it would only work for HTTP but that seems to be the point here. – Julie Pelletier Jul 23 '16 at 06:24
  • 2
    @KhalifaEsha: The only people who have such requests think an IP address is something private but anyone that can access your website with the domain name can very easily know its IP address and that's OK. – Julie Pelletier Jul 23 '16 at 06:25
  • @AubreyRobertson not disable the ip i just want people access from the domain name not from the ip address, is that possible? – Khalifa Esha Jul 23 '16 at 06:25
  • 1
    A more useful solution would be to redirect traffic to the domain. In any case, why would anyone want to use the IP instead of the domain name and why the heck do you care? – Julie Pelletier Jul 23 '16 at 06:26
  • This is the way it's designed to work @KhalifaEsha. Like Julie said, you can ping any website and get its IP address trivially. You can then type that IP address into your browser to access the website. This is normal behaviour. – Aubrey Robertson Jul 23 '16 at 06:37
  • @AubreyRobertson If it is designed to work like that, it's okay. This becomes the new knowledge for me, because I'm really new at this. I had thought it might be safer if they do not directly access the ip address of the form. Thank's Julie, thank's aubrey. – Khalifa Esha Jul 23 '16 at 07:05
  • 1
    http://serverfault.com/q/444217/126632 – Michael Hampton Jul 23 '16 at 08:57
  • 1
    @Aubrey: for TCP domainname and IPaddr are equivalent; for WWW specifically HTTP/1.1 not. With v4 addrs now scarce, you can have 2 or 5 or 30 or 1000 domainnames map to one addr; the browser connects to the same addr but supplies the domainname in the Host: header (and SNI extension for HTTPS) so the server can provide different content depending on which 'virtual' host you asked fo. This doesn't work if you only tell the browser the addr. – dave_thompson_085 Jul 23 '16 at 10:18

0 Answers0