Block specific (sub)domains without editing hosts file

mikolajek

Member
Member
Messages
65
Location
Warsaw, Poland
Hi all,

Can you please recommend an application doing similar job as adding records to the hosts file does? I'm looking for a tool capable of blocking connections for particular subdomains (not entire domains).

I don't really want to install another firewall (as I'm already using one) and I'm not sure if a firewall is able to block subdomains - I've always thought it's meant rather for working with IP addresses.

Your help is highly appreciated!
 

My Computer

System One

  • OS
    Windows 8.1 Pro x64
    Computer type
    Laptop
    System Manufacturer/Model
    Dell Precision M4800
    CPU
    Intel i7-4900MQ
    Memory
    32 GB
    Graphics Card(s)
    Intel HD Graphics 4600 & nVidia Quadro K2100M
    Monitor(s) Displays
    Dell U2312HM & Dell 2408WFP
    Screen Resolution
    1920x1080 & 1920x1200
    Hard Drives
    Samsung 840 EVO 256 GB & Hitachi TravelStar 5K750 750 GB
    Browser
    Firefox 32
    Antivirus
    Kaspersky Internet Security 15
Use OpenDNS Parental controls. Otherwise you would have to use a router that allows you to set it at the router, in case someone figures out how to change the settings for the adapter DNS, to bypass the security.

A Firewall is the first layer of protection. They are made to allow an admin to protect each computer from receiving info from possible intrusions. Also allows you to stop end users from getting to malware sites, or attempt to go to certain IP's or URL's.
 

My Computer

System One

  • OS
    Linux Mint 17.2
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satellite C850D-st3nx1
    CPU
    AMD E1-1200 APU with Radeon (tm) HD Graphics 1.40 GHZ
    Memory
    12GB
    Graphics Card(s)
    AMD Radeon™ HD 7310 Graphics
    Sound Card
    Realtek HD
    Monitor(s) Displays
    LCD
    Screen Resolution
    1366 x 768
    Hard Drives
    Crucial M500 240GB SSD
    Mouse
    Logitech M525
    Internet Speed
    45/6 - ATT U-Verse
    Browser
    Google Chrome
    Antivirus
    None needed. It is Linux.
    Other Info
    Arris NVG589 Gateway; Router - Cisco RV320; Switch - Netgear GS108 8-Port Switch & Trendnet TEG-S50g 5-Port Switch; Access Points - Engenius ECB350, Trendnet TEW-638APB; NAS - Lenovo ix2-4; Printer - Brother HL-2280DW; Air Print Server - Lantronix XPrintServer

    A/V UPS - Tripp-Lite Smart 1500LCD 1500 Va/900 W.
Why not use hosts?????
 

My Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
@Ztruker - yes, I'm fully aware this is a simple and convenient way of disabling access to certain sites. However, it looks it's not efffective enough in my case, as even though I have set certain subdomains to 127.0.0.1, I'm still able to receive response from those sites (meaning I'm not ending up in 127.0.0.1 as expected). I've double checked the hosts file and it's set up correctly, moreover it works correctly at my home. Just the work machine seems to ingnore hosts settings...
 

My Computer

System One

  • OS
    Windows 8.1 Pro x64
    Computer type
    Laptop
    System Manufacturer/Model
    Dell Precision M4800
    CPU
    Intel i7-4900MQ
    Memory
    32 GB
    Graphics Card(s)
    Intel HD Graphics 4600 & nVidia Quadro K2100M
    Monitor(s) Displays
    Dell U2312HM & Dell 2408WFP
    Screen Resolution
    1920x1080 & 1920x1200
    Hard Drives
    Samsung 840 EVO 256 GB & Hitachi TravelStar 5K750 750 GB
    Browser
    Firefox 32
    Antivirus
    Kaspersky Internet Security 15
What do you mean by sub-domains? Most web servers are actually Virtual Machines running on one Blade Server, or physical server.

As for work. Most likely if they are using a domain or the router is set to use a different set of rules through a Proxy. Your web browser will never even see the Host file in the picture.
 

My Computer

System One

  • OS
    Linux Mint 17.2
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satellite C850D-st3nx1
    CPU
    AMD E1-1200 APU with Radeon (tm) HD Graphics 1.40 GHZ
    Memory
    12GB
    Graphics Card(s)
    AMD Radeon™ HD 7310 Graphics
    Sound Card
    Realtek HD
    Monitor(s) Displays
    LCD
    Screen Resolution
    1366 x 768
    Hard Drives
    Crucial M500 240GB SSD
    Mouse
    Logitech M525
    Internet Speed
    45/6 - ATT U-Verse
    Browser
    Google Chrome
    Antivirus
    None needed. It is Linux.
    Other Info
    Arris NVG589 Gateway; Router - Cisco RV320; Switch - Netgear GS108 8-Port Switch & Trendnet TEG-S50g 5-Port Switch; Access Points - Engenius ECB350, Trendnet TEW-638APB; NAS - Lenovo ix2-4; Printer - Brother HL-2280DW; Air Print Server - Lantronix XPrintServer

    A/V UPS - Tripp-Lite Smart 1500LCD 1500 Va/900 W.
@Ztruker - yes, I'm fully aware this is a simple and convenient way of disabling access to certain sites. However, it looks it's not efffective enough in my case, as even though I have set certain subdomains to 127.0.0.1, I'm still able to receive response from those sites (meaning I'm not ending up in 127.0.0.1 as expected). I've double checked the hosts file and it's set up correctly, moreover it works correctly at my home. Just the work machine seems to ingnore hosts settings...

If you are still getting a response from a sub domain after setting it to 127.0.0.1 in the host then you have done something wrong, some browsers cache dns and do need a reboot - did you reboot after setup?
 

My Computers

System One System Two

  • OS
    Windows 10
    Computer type
    PC/Desktop
    System Manufacturer/Model
    me
    CPU
    i9
@bore23 - I'm looking to disable only a particular subdomain, like: video.site.com, while still being able to access www.site.com or audio.site.com

@z3r010 - sure I did reboot :)
 

My Computer

System One

  • OS
    Windows 8.1 Pro x64
    Computer type
    Laptop
    System Manufacturer/Model
    Dell Precision M4800
    CPU
    Intel i7-4900MQ
    Memory
    32 GB
    Graphics Card(s)
    Intel HD Graphics 4600 & nVidia Quadro K2100M
    Monitor(s) Displays
    Dell U2312HM & Dell 2408WFP
    Screen Resolution
    1920x1080 & 1920x1200
    Hard Drives
    Samsung 840 EVO 256 GB & Hitachi TravelStar 5K750 750 GB
    Browser
    Firefox 32
    Antivirus
    Kaspersky Internet Security 15
You're going to need something a little mire specialized.

DansGuardian running on a server that sits between your network and the internet would work very well if set up right.

That might be overkill though.

As far as ignoring the hosts file goes. Does the work computer use ipv6? :)
 

My Computer

System One

  • OS
    Kernel 4.x
    Computer type
    PC/Desktop
    CPU
    i5 3570K
    Motherboard
    P8Z77-V LK
    Memory
    G.skill Ripjaw Z 2133MHz 9-11-10-28
    Graphics Card(s)
    GTX770 4GB Dual BIOS
    Sound Card
    Audigy 4 Pro
    Monitor(s) Displays
    32" SAMSUNG HDTV
    Screen Resolution
    1920x1080 progressive
    Hard Drives
    10TB total
    3 RAID arrays
    3 single disks
    PSU
    Corsair HX750
    Case
    Corsair R400
    Cooling
    Corsair H100
    Keyboard
    Logitech G510
    Mouse
    Logitech G5
    Internet Speed
    ~900mbps (~115MB/s) down, ~10mbps(~1.5MB/s) up
    Browser
    Firefox & Chromium
    Antivirus
    Common Sense
With my Cisco RV320 Gateway, I can trust or Forbid certain domain access. That includes sub-domains. You would still access the Primary domain, as long as you have your rules set up properly.
 

My Computer

System One

  • OS
    Linux Mint 17.2
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satellite C850D-st3nx1
    CPU
    AMD E1-1200 APU with Radeon (tm) HD Graphics 1.40 GHZ
    Memory
    12GB
    Graphics Card(s)
    AMD Radeon™ HD 7310 Graphics
    Sound Card
    Realtek HD
    Monitor(s) Displays
    LCD
    Screen Resolution
    1366 x 768
    Hard Drives
    Crucial M500 240GB SSD
    Mouse
    Logitech M525
    Internet Speed
    45/6 - ATT U-Verse
    Browser
    Google Chrome
    Antivirus
    None needed. It is Linux.
    Other Info
    Arris NVG589 Gateway; Router - Cisco RV320; Switch - Netgear GS108 8-Port Switch & Trendnet TEG-S50g 5-Port Switch; Access Points - Engenius ECB350, Trendnet TEW-638APB; NAS - Lenovo ix2-4; Printer - Brother HL-2280DW; Air Print Server - Lantronix XPrintServer

    A/V UPS - Tripp-Lite Smart 1500LCD 1500 Va/900 W.
@hydranix - no, I don't think our network uses IPv6, as I can disable it in the settings and everything keeps working.
 

My Computer

System One

  • OS
    Windows 8.1 Pro x64
    Computer type
    Laptop
    System Manufacturer/Model
    Dell Precision M4800
    CPU
    Intel i7-4900MQ
    Memory
    32 GB
    Graphics Card(s)
    Intel HD Graphics 4600 & nVidia Quadro K2100M
    Monitor(s) Displays
    Dell U2312HM & Dell 2408WFP
    Screen Resolution
    1920x1080 & 1920x1200
    Hard Drives
    Samsung 840 EVO 256 GB & Hitachi TravelStar 5K750 750 GB
    Browser
    Firefox 32
    Antivirus
    Kaspersky Internet Security 15
If you point video.site.com to Localhost or 127.0.0.1 in hosts that should be all that's affected in that domain. Any other site.com should be okay. Is this not what you experience?
 

My Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
127.0.0.1 should only be used for localhost.

To block hostnames instead use 0.0.0.0

Using 127.0.0.1 will cause requests on the loopback interface and will need to timeout.
If you run a webserver or a special proxy locally, you could run into trouble and potentially security problems.

0.0.0.0 has far better performance, and no chance of something hosted locally slipping into a browser or causing other unintended harm.


I also recommend setting a dummy hostname at the top of the hosts file for 0.0.0.0 to something like "everywhere".


Most tools that monitor network connections resolve through the hosts file, and when a process which is listening on all interfaces (most do) is listed in the tool, it will inaccurately report that the process is connected to the top most entry for 0.0.0.0
 

My Computer

System One

  • OS
    Kernel 4.x
    Computer type
    PC/Desktop
    CPU
    i5 3570K
    Motherboard
    P8Z77-V LK
    Memory
    G.skill Ripjaw Z 2133MHz 9-11-10-28
    Graphics Card(s)
    GTX770 4GB Dual BIOS
    Sound Card
    Audigy 4 Pro
    Monitor(s) Displays
    32" SAMSUNG HDTV
    Screen Resolution
    1920x1080 progressive
    Hard Drives
    10TB total
    3 RAID arrays
    3 single disks
    PSU
    Corsair HX750
    Case
    Corsair R400
    Cooling
    Corsair H100
    Keyboard
    Logitech G510
    Mouse
    Logitech G5
    Internet Speed
    ~900mbps (~115MB/s) down, ~10mbps(~1.5MB/s) up
    Browser
    Firefox & Chromium
    Antivirus
    Common Sense
@hydranix - the 0.0.0.0 trick worked! Thank you so much for that!

Now when I try to connect to e.g. video.site.com, it's no longer working, while with 127.0.0.1 it somehow worked. This might have been some setting within corporate network / my machine config that was overwritting typical behavior when such settings are recorded.
 

My Computer

System One

  • OS
    Windows 8.1 Pro x64
    Computer type
    Laptop
    System Manufacturer/Model
    Dell Precision M4800
    CPU
    Intel i7-4900MQ
    Memory
    32 GB
    Graphics Card(s)
    Intel HD Graphics 4600 & nVidia Quadro K2100M
    Monitor(s) Displays
    Dell U2312HM & Dell 2408WFP
    Screen Resolution
    1920x1080 & 1920x1200
    Hard Drives
    Samsung 840 EVO 256 GB & Hitachi TravelStar 5K750 750 GB
    Browser
    Firefox 32
    Antivirus
    Kaspersky Internet Security 15
Back
Top