Block access to website from router(using its IP adress) - networking

I'm trying to block access to a website (e.g site.com), to do so I used dig site.com to get the site's IP adress (I'm on Ubuntu). The result will be something like this:
site.com. 10000 IN A 101.53.182.181`
Then mapped new IP ( localhost ) to the domain name 'site.com' on /etc/hosts, as the following:
127.0.0.1 site.com
That will do the thing for my local machine, but not for the whole network's devices.
Also tried to configure from the router using telnet 192.168.1.1 but I lost it, I don't know how to do it.
How can I manage to block traffic from that particular site? Is there anyway to block access to websites using their IP address?
PS: I tried the classic way to block the site using its domain name (e.g site.com), but it doesn't really 'block the site', I can still access it by searching the website on Google.

You can try accessing your router's web interface. Make sure to set your computer's (laptop's) IP address manually to 192.168.1.2, subnet mask to 255.255.255.0 and then gateway to 192.168.1.1 for the computer's Eth0 interface. I suggest to use the wired interface instead of WLAN or WiFi. Then, access the router on a web browser using 192.168.1.1.
In your router's settings page, look for the following:
Block Sites
Access Restrictions
Security
Advanced
or something similar to the mentioned categories above. This may depend on the settings, so I advise to refer to your router's manual. Once you find the setting, indicate the domain/s or IP address (via dig) that you want to block, then apply the settings or changes that you have made.

Related

how do i make my website accessible from the internet without a static ip and from a virtual machine?

I have windows 8 host and i have installed ubuntu 14.10 server as a virtual machine in vmware. i have installed LAMP server and i am trying to host a website from it. i have created a virtual host. my website is accessible in the host machine when i go to the address 192.168.0.106.
my router info:
LAN
IP Address :192.168.0.1
INTERNET
IP Address :10.30.XXX.XXX
"what is my ip" in google: 113.XXX.XXX.XXX
how do i make my website accessible from the internet ? I know it is a dumb question, but i tried searching everywhere and could not get the solution.
Since you say that you can connect to the site from the host machine, it does not matter that it is in a VM.
You say that you can connect to your site via: 192.168.0.106 on the LAN. You need to forward connections to your WAN address (113.193.56.198) to your LAN address (192.168.0.106). You can do this in most router settings in a section called Port forwarding. Use port 80 if you're hitting the LAN IP from a browser and you don't have to add a port after the address like http:\\192.168.0.106:1234. Otherwise, use whatever port you like.
Once you get that working, it is a good idea to use a dynamic DNS service, which will connect your IP to a domain name and update the connection whenever your WAN IP changes. This way, instead of using the WAN IP in a browser, you can use your domain name and it should always work. But that's not your first problem. First get it working with the WAN IP by itself. Once you've got that working, get some DynDNS.
EDIT
If you think it should be working but can't figure out why it isn't, use a tool like nmap/zenmap to scan your WAN and LAN IPs. That will help you diagnose the problem.
A DynDNS should do the job!
It will automatically renew your dynamic ip address. All you need is; a tool that runs on your server with website.
Search for it on google, and you'll find a solution. Btw: there are, Free and paid solutions.
EDIT: by the way, your router requires additionally some port forwarding to make your website accessible from outside. Even with the DynDNS stuff installed.
Just to give you some indications.

How To Access External IP Inside Own Network?

This is my representation of our ip here in our home network.
Default Gateway - 192.168.1.1
Server - 192.168.1.4
External IP(Our ip with the help of whatsmyip.org) - 122.x.xx.xxx
I'm the one that is using the server what I want is to access our external ip even inside the same network, what is currently happening is when I type in the url our external ip which is 122.x.xx.xxx, the browser redirects me to my default gateway which is the configuration page of our router.
*Note: other computer(computer shop, mobile phone on 3G etc.) which is outside the network have access on our external ip, and they have access on the file that I put on there, for example they type on the url: 122.x.xx.xxx/SamplePHP the browser will display the PHP program that I created.
Do you want to setup port redirection for your webserver or get access to all resources on your internal network like you were in the internal network?
If the former, I would consult your router's manual for more details on how to setup port forwarding. Long story short, exposing your router's webserver to the outside world (at least on the default ports -- security in obscurity :)!) is a bad idea from a security perspective.
If the latter, you could look at setting up VPN to access internal network resources more securely (a really good idea if your webserver/web app is only setup to run plaintext traffic -- but this would only prevent MitM/sniffing over the Internet and not on your local network). I would consult your router's manual (again) for more details. For what it's worth you may have to setup port redirection via your router to achieve this if VPN support isn't built into the router.

How to stop redirect to default website when IP address is entered in the address bar of the browser?

I have multiple websites hosted on our server. When someone types the IP address in the address bar of the Browser It redirects to one of the websites hosted on the server. Is there any way by which I can set the default website which is opened when some one types the IP address. Same IP address is being shared by multiple websites.
1 IP address can only bind to 1 IIS Entry. So what you need to do is to pick the IIS entry you want, go the "Binding" section and bind your IP as the binding header.
ex: If your IP is 1.1.1.1 , then in binding header, you put 1.1.1.1, in IP address, you also choose 1.1.1.1.
After you setup this binding, you can browse to 1.1.1.1 and it'll open your site.
Remember to make sure all other sites doesn't have this binding. Otherwise, it'll have an conflict.
All you have to do is leave off the IP address and host name entries, and provided you have only a single website matching that, that site will become the 'default', while your other sites will have specific host name(s) they respond to.
I am not sure, but you may have to add a specific host in the C:\\Windows\System32\drivers\etc\hosts file, giving IP address and its corresponding address, this definitely works from logging into the website where it is hosted, i.e on the hosting server.
For logging from different IP machines, try the same logic - in this case make sure that the gateway is same for LAN.
Let's see what happens in this case ??

Access localhost from another computer not on network

Before you say that it is a dupe, this is not the same as this, this, this or this.
My question is how do you do it globally.
For instance, consider this. I have EasyPHP running in my computer. At present my ip address (global) is 223.231.178.118
Now, let's say there is someone else (maybe in a different country altogether) who wants to access my ip (223.231.178.118). I do know how to access 192.168.x.x from the same network. I just want to know how you can do this globally, if possible.
P.S 1 : The computer running EasyPHP is behind a router.
P.S 2 : My IP (local IP is, but global one is not) is not static. But let us assume the person who wants to access my localhost does know my Dynamic IP. For example, let us assume I tell the person who wants to access my localhost is my friend and I tell him over phone what my IP is.
You can use tools just like ngrok or Forward
more tools are in this post Accessing localhost From Anywhere
Your local IP address "192.168.x.x" is only known to your router and unknown to everyone outside your LAN. The global IP address (223.231.178.118 in your example) is the global address of your router.
To be able to access the EasyPHP server on your local computer you need to forward the corresponding port (for http webservers the default is 80 but it might be different for EasyPHP) from your router to your local IP. You need to check your routers manual on how to do this.
After you have done that you can just tell the person who wants to access your local computer the global ip address of your router and he will see your EasyPHP response by browsing to that global address.

Broadcast your internet ip

i want to do something like broadcasting my application over internet using my ip.
I have a static IP say a.b.c.d and want to deploy some application say a war file in tomcat on port 8080 so that some remote friend of mine who is not on network can access it over internet using http://a.b.c.d:8080 in browser. i have windows vista/XP installed on my system.
thanks, hope i made the question clear i am still confused with it :(
If you truly have a static IP, and your computer is not behind a NAT box or firewall, then if a.b.c.d is that static address, what you've described will simply work. If you do have a firewall, you have to add an exception to allow requests in. If you've got a NAT box, which you would use to share that static IP among computers, then you need to set the NAT box up to forward requests on that one port to your computer. FInally, if you want a.b.c.d to be a name, rather than numbers, then you need to register a domain name with a registrar like GoDaddy.com and pay some money.
You can use dyndns and set up a domain for your friend to access. www.dyndns.com
Dynamic DNS service allows you to point a hostname to a dynamic or static IP address or URL.

Resources