About the hosts file (syntax/usage question)

Hi,
I am trying to block a handful of different websites that I do not want my daughter to use right now.  I would like to use the hosts file to do this.  Although I have basic familiarity with the hosts file and editing it, I am not completely certain as to how it works and how DNS works.  If I want to, for example, block "yahoo.com" and all of its subdomains, would the following be an acceptable/valid entry?
127.0.0.1 *.yahoo.com
By not listing the subdomains of "yahoo.com", would that make it any liklier for those webpages to get through?  If I were to also list out all of the "yahoo.com" subdomains that I have knowledge of along with the previous entry, would that cause any problems?
And the second part of my question is: Is the hosts file ever not top priority in lookup (on OS X 10.6.8, if it matters); and if so, is there a good way to make it always first?
Any help would be appreciated!
Thank you,
Michael

Use parental controls, maybe Dnsmasq, or a nanny-capable firewall-gateway-router box that's been configured on the edge of your network.
The /etc/hosts file also has specific sequence to get it reloaded; that file is read once and subsequenty cached.  IIRC, you need to either /sudo dscacheutil -flushcache/ or /sudo killall -HUP mDNSResponder/ the DNS resolver.
If your child is technically inclined, or knows how to do basic internet research, or has discussions with the more nerd-ish among her peers, your child can learn how to bypass /etc/hosts and Dnsmasq using her own DNS translations, or with her own DNS services.  That possibility would point toward either parental controls (easy), or the firewall-gateway-router box (added cost, but can block some or all systems on your local network).
Here's how easy it is to bypass the /etc/hosts block; launch Terminal.app and issue the equivalent of:
dig +short @8.8.8.8 host.example.com
for the host.example.com host that you're (she's) interested in.  (There are other commands that can be used; more than just dig can be used here, and there are web sites that can perform this translation for you.)  Then connect to the IP address that this command emits.  Your /etc/hosts block will not prevent this, and will not block this.
If your daughter is somewhat more technically savvy, a VPN will bypass the /etc/hosts blocks.  She'll need access to a VPN server, and those are available from various free and very low-cost sources...

Similar Messages

  • What is the real ip address to the apple server? Someone changed the host file in windows/system32/drivers/ect, and now I can't do a restore on my iPhone 3gs.

    What is the real ip address to the apple server? Someone changed the host file in windows/system32/drivers/ect, and now I can't do a restore on my iPhone 3gs

    "You have to change your router's IP address to be able to access it. It will not give you the internet."
    I'm not sure what that means Richard, but I did change the router's IP address from 192.168.1.1 to 192.168.5.1- isn't that what you meant in your first post. I know that isn't reflected in my screen capture that I took last night, but I did do that this morning after I read your post.
    "Log on to your router and change two settings.
    Change the setting in Setup from PPPoE to Automatic Configuration-DHCP and click on save.
    Click on Advance Routing and change the setting from Gateway to Router then click on save."
    I did this and still same results as far as I can tell. Can't get online through the router.
    "Click on MAC address clone under setup tab ... click enable & click clone ...click save settings ... Check the IPaddress under WAN page ....
    If getting IP in public range .... try going online ...."
    I tried this- at least to the part about checking the IP address under WAN. I assume you mean the WAN page in the modem setup- nothing looked any different after trying what you suggested, and I'm not really sure where I would be "getting IP in public range" or what that means.
    I'm about to give up and just buy a new router to see if I can get the same lack of results with a different one. My ISP maintains that everything is set up correctly on their end and really can't do anything more for me. The Modem works and is set up correctly and they can give tech support for a router.
    Here's what my basic setup looks like now:
    http://i490.photobucket.com/albums/rr270/SukarUDL/BasicSetup.png
    Here's what the advanced tab looks like now:
    http://i490.photobucket.com/albums/rr270/SukarUDL/AdvancedRouting.png
    Modem setup looks the same
    Message Edited by Writersbloc on 09-25-2008 07:05 PM

  • Cannot get the hosts file to operate or change.

    I have tried to every way I could find on the internet to change the hosts file on my Mac OS X 10.4.11 computer plus several newer macs that operate in my office. I was able to easily do it on the PC's but not on the Macs. I modified the /etc hosts file directly to no avail, modified it using the terminal commands and also tried using the NetInfo manager. I am NOT a tech guy, just a guy trying to get his computers to work properly. A tech company just changed our router to a Cisco ASA device which is why this change needs to be made, they did not know how to make the changes to the hosts files on a Mac. Everybody in the office loves our Macs so to not be able to get to our own website and webmail is frustrating. Here is what I changed the hosts file to:
    # Host Database
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    127.0.0.1 localhost
    192.168.16.2 auctionbid.stoutauctions.com
    192.168.16.3 mail.stoutauctions.com
    192.168.16.3 smtp.stoutauctions.com
    192.168.16.4 stoutauctions.com
    255.255.255.255 broadcasthost
    ::1 localhost
    Is something else in the system I need to change to make this take effect? Is something set wrong? Any help would be greatly appreciated.
    Also if anyone knows of a reputable company that will do remote work on Macs, please let me know. I have a few things that I don't know how to do and would not be worth a trip to the middle of nowhere for a tech company so if they can do it remotely that would be great.
    Thanks!
    Greg

    Hmmm, the line after...
    127.0.0.1 localhost
    Should be...
    255.255.255.255 broadcasthost
    Not sure if that is it or not.
    Did you see this article, especially for adding from a hosts.txt file?
    http://support.apple.com/kb/TA27291?viewlocale=en_US
    Did you flush the DNS Cache after changes?
    How to Flush DNS in Mac OSX using Terminal...
    In Mac OSX Leopard, you can use the command dnscacheutil -flushcache to flush the DNS resolver cache:
    dnscacheutil -flushcache
    In Mac OSX versions 10.5.1 and before, the command lookupd -flushcache performed the same task:
    lookupd -flushcache

  • How do I edit the hosts file in Lion

    I tried to edit the hosts file in Lion with: sudo nano /private/etc/hosts. Then entered Password. The window came up blank evev though I know there is data there.

    Thanks BD for your response. I have looked at Youtube where they are demonstrating how to do this by using sudo nano /etc/hosts. After entering the Password it shows a screen with the text of the hosts file. On the bottom of the screen it shows the number of lines read. When I do the same thing I get a blank screen and on the bottom it says no file. I am either doing something wrong or this does not work. I even tried changing the permissions of the hosts file to R & W for system, wheel, and everyone. This also did not work. I have not tried Hostal yet but if I can't find a simple way to text edit the hosts file I will give it a try.

  • How do I edit the host file in ipad

    I would like to test our site and would like to point the URL to a different server. Is there a way to edit the hosts file similar to how you would do it on other computers?

    iPhoneView will let you get at your system files.
    Check out the new remodeled MacOSG website! 24-hour Apple-related news & support.
     MacOSG: An Apple User Group  iTunes: MacOSG Podcast  Follow us on Twitter: MacOSG

  • HT201210 I have done all of the things on this list, to include editing the hosts file with no the same error each time (3194).  I am trying to restore my iphone 4 ios 6 to get it unlocked.  Diagnostics show no issue communicating with apple. Help.

    I am trying to restore my iphone 4 ios 6 to acheive unlock.  hit restore and it unloads software, confirms with apple then displays the 3194 error.  I have turned off my virus scanner, unplugged all usb except for iphone, edited the hosts file and run diagnostics which showes communication with apple is fine.  What do I need to do to get my ipone to restore?

    There is nothing wrong with the OS update.
    Delete ALL your email accounts.
    Restart Playbook
    Put the accounts back and ensure they are all set with PUSH ON.  Manual (push off) will burn battery.
    Similarly delete your wifi connections and add back when required. 
    Turn off wifi is not connected to wifi. 
    Any "hunting for connection" in email or wifi will burn up battery.

  • Downloading files - can I block the empty file from appearing at all? I'm not talking about the .part file, but the one that disappears later anyways.

    Let's say I'm downloading several files, for each file that I'm downloading two new files appear in my download folder. For 'vol1.rar' I have ''an empty'' 'vol1.rar' and a 'vol1.rar.part' file, same for 'vol2.rar', 'vol3.rar', etc.
    I would like to block this empty 'vol1.rar' file from appearing at all - it disappears after the download is finished anyway, and the .part file gets renamed with the actual name.
    I'm downloading files to my desktop, from where I move them to the folders I want them in - having this disappearing 2nd file messes up the order I download the files in - if I add a new file after one of the files I was downloading has finished, the file be placed in the empty spot that the finished file has created, making it harder for me to move to the correct folder.
    A lot of people have asked if it was possible to turn off the .part file, but I haven't seen a single thread about the empty file instead.
    I know this file isn't necessary, because I moved it to another folder/deleted it many times before the download was finished and the real file was still fine.
    So, any ideas as to how to block this file?

    I don't believe there is any way to prevent file downloading if you allow internet access at all. as Király says, whatever they download and install will be limited to the guest account and will go poof on the logout.
    however you can disable CD/DVD and external drives access. some of it can be done by enabling parental controls on the guest account. for more options you can install server admin tools
    http://support.apple.com/downloads/ServerAdmin_Tools_105
    and use workgroup manager to set further restrictions on the guest account.
    P.S. workgroup manager can also forbid guest to mount disk images which will effectively make it impossible to install any programs at all even in the guest account.
    Message was edited by: V.K.

  • Portal Access without configuring the Hosts file

    Hello experts,
    Is possible to access the SAP Portal By mentioning the IP address in the URL without configuring the Hosts file?
    Please suggest me.
    Thanks.

    >
    Stars wrote:
    > Hello Baskaran,
    >
    > Thanks for your frequent response. I didnu2019t configure the DNS. If I configure DNS now then it will affects the SAP installation. Please suggest me.
    >
    > Thanks.
    Hallo Stars,
    I am not able to understand the relation between the configuring DNS and affecting SAP installation. If you do not want to do the host file change or DNS configuration, i wonder how could your url request with Ip adress and port knows the physical server to  reach.
    Anyways it is going beyond Webdynpro-ABAP forum to the Networking,systems area. I request Moderators to replace this to appropriate forum.

  • Exchange 2013 mailflow and the Hosts file

    Hello!
     Recently I expirienced the issue with missing messages ( http://social.technet.microsoft.com/Forums/en-US/20745ec5-e311-4bc0-b1bd-aff3f7c82fd1/missing-messages?forum=exchangesvradmin ) and although that thread is not answered yet I would like
    to clarify the following:
    1) Exchange Server is working properly for day1 and day2
    2) Day3: Sent messages begin to disappear
    Resolution: I add my Exchange Server to the hosts file (on the Exchange Server machine), restarted the server and the mailflow was restored.
    192.168.1.2 Mail
    192.168.1.2 Mail.Test.Local
    Test: Right after deleting Exchange Server records from Hosts and restarting the server the mailflow gets disrupted again.
    Q1: Is it a bug?
    Q2: If it's a bug why my Exchange has been working fine for day1 and day2?
    Thank you in advance,
    Michael

    Hello all!
    Here's my post that describes the issue:
    http://social.technet.microsoft.com/Forums/exchange/en-US/20745ec5-e311-4bc0-b1bd-aff3f7c82fd1/missing-messages?forum=exchangesvradmin
    There're two servers (VMs): Domain Controller and Exchange 2013. As I have no internet connection in my test environment only internal mail go missing.
    Regarding Hosts file: as those post is still not answered I just did what MS support recomended for resolving Exchange 2013 DNS issue (there're a lot of posts regarding it here on technet) and it helped...
    But it's nonsense - my DNS is up and running, it was running on Day1, Day2 and  Exchange could use it successully, but starting with the Day3 Exchange Server can't use the same DNS server? Why??? 
    Regards,
    Michael

  • Does anybody have any idea where the hosts file is?

    Where is the host file, the one that I need to change so I can trick my browsers to look up a domain that's not online yet.

    The Hosts file is located at /private/etc/hosts. You can use the following command in the Terminal to access and change it:
    sudo pico /private/etc/hosts
    This command will ask you for your administrator password, which will not produce anything on the screen while it is being typed. The Terminal is in the /Applications/Utilities/ folder.
    (14492)

  • Question about the java files which created by Web Dynpro

    After I create a new project under Web Dynpro, there is no any java file is generated.
    Now I create a new application in the project with the following names:
    application name: QuizApp
    package name: com.sap.tc.webdynpro.tutorials.quiz
    component name: QuizComp
    window name: Quiz
    view name: WelcomeView.
    Now, 5 java files are generated under the package:
    QuizComp.java,
    WelcomeView.java,
    QuizCompInterface.java,
    QuizInterfaceView.java
    QuizCompInterfaceCfg.java
    Can someone tell me what do these file mean? For what purpose?

    1)QuizComp.java -
      this is the source file for whatever you code inside the Component Controller ,
    2)WelcomeView.java -
    you get one java file for each view you create,
    3)QuizCompInterface.java -
    represents the public "face" of your component. If this webdynpro DC is used by another DC, the other DC can only "see" the methods present in this java class
    4)QuizInterfaceView.java    -
    this is to represent your view assembly (window and any views as part of it) when you want to embed UI of this DC in another DC
    5)QuizCompInterfaceCfg.java -
    (advanced concept)
    P.S: A java file is created for each Custom controller you create also. And many other classes get created too (which probably you dont need to bother about) but they require for WebDynpro concept to function properly i.e a framework
    Hope that clears things.
    Regards,
    Rajit

  • Two questions about the PSD file format specicaition

    I'm a programmer dealing with a project to parse PSD files. When reading the official file format specification, I found that some fields of the file are not clarified:
    1. There is a rectangle structure containing 4 fields: top, left, buttom, right. I wanna know whether these 4 fields can be negative values and is there a rule that the buttom shoud be larger than the top and the right shoud be larger than the left
    2. The PSD file contains a color mode section. But if the color mode is RGB, the color mode section contians no data but a 4-byte length field whose value is set to 0. This is true for files in RGB mode 8-bit channel. But after convert the files to RGB mode 32-bit channel using photoshop, the whole color mode section is no long exist.
    These two questions may be somehow technical, I would be thankful if someone can give me a hand.

    1) was covered in the documentation at one time.  Yes, many of them can be negative, that's why they're signed values.  Valid rectangles will have the bottom greater than the top, and the right greater than the left. But you can also have empty rectangles, and sometimes invalid rectangles (because the values don't matter).
    2) Not sure what you're asking...  color mode is just a single enumeration for RGB, CMYK, etc.

  • No visible cursor, and question about the help-file

    Right now I am using a temporary computer, as mine is being re-formated.
    When I opened Illustrator to change a text-line in a picture, there was no cursor when I clicked on a word. I could still make my change, but no blinking cursor to tell me where I was. Can somebody please tell me where that setting is? It feels like I am working blind...
    I looked for this in the help-file, and while doing that (and not finding the answer), I wondered, as so many times before, how they thought at Adobe when they constructed the help-file as it is now... If I open the help-file in Illustrator, select that I want an answer for Illustrator (the icon to the right of the search-box) WHY do I get answers for InDesign, Bridge and other programs???? WHY not just for Illustrator? I am NOT interested in those programs right now, I want an answer for Illustrator. Please tell me there's a setting or something to fix this, because this drives me crazy each time I want help with something.
    Lena
    Sweden

    Thanks for your answer. For some strange reason the problem is now fixed... I checked the second box in Settings/General that says something like "use exact cursors", restarted the program and no change. Then I went for a coffee break and now it works
    So how do I download the pdf help-file?
    Lena

  • Confused about the log files

    I have written an application that has a Primary and Secondary database. The application creates tens-of-thousands of records in the Primary database, with a 1-to-1 relationship in the Secondary. On subsequent runs it will either update existing Primary records (which should not update the secondary as that element does not change) or it will create new records.
    The application actually works correctly, with the right data, the right updates and the right logical processing. The problem is the log files.
    The input data I am testing with is originally 2Mb as a CSV file and with a fresh database it creates almost 20Mb of data. This is about right for the way it splits the information up and indexes it. If I run the application again with exactly the same data, it should just update all the entries and create nothing new. My understanding is that the updated records will be written to the end of the logs, and the old ones in the earlier logs would be redundant and the cleaner thread would clean them up. I am explicitly cleaning as per the examples. The issue is that each run, the data just doubles in size! Logically it is fine, physically it is taking a ridiculous amount of space. RUnning DbSpace shows that the logs are mostly full (over 90%) where I would expect most to be empty, or sparsely occupied as the new updates are written to new files. cleanLog() does nothing. I am at a total loss!
    Generally the processing I am doing on the primary is looking up the key, if it is there updating the entry, if not creating one. I have been using a cursor to do this, and using the putCurrent() method for existing updates, and put() for new records. I have even tried using Database.delete() and the full put() in place of putCurrent() - but no difference (except it is slower).
    Please help - it is driving me nuts!

    Let me provide a little more context for the questions I was asking. If this doesn't lead us further into understanding your log situation, perhaps we should take this offline. When log cleaning doesn't occur, the basic questions are:
    a. is the application doing anything that prohibits log cleaning? (in your case, no)
    b. has the utilization level fallen to the point where log cleaning should occur? (not on the second run, but it should on following runs)
    c. does the log utilization level match what the application expects? (no, it doesn't match what you expect).
    1) Ran DbDump with and withour -r. I am expecting the
    data to stay consistent. So, after the first run it
    creates the data, and leaves 20mb in place, 3 log
    files near 100% used. After the second run it should
    update the records (which it does from the
    applications point of view) but I now have 40mb
    across 5 log files all near 100% usage.I think that it's accurate to say that both of us are not surprised that the second run (which updates data but does not change the number of records) creates a second 20MB of log, for a total of 40MB. What we do expect though, is that the utilization reported by DbSpace should fall to closer to 50%. Note that since JE's default minimum utilization level is 50%, we don't expect any automatic log cleaning even after the second run.
    Here's the sort of behavior we'd expect from JE if all the basics are taken care of (there are enough log files, there are no open txns, the application stays up long enough for the daemon to run, or the application does batch cleanLog calls itself, etc).
    run 1 - creates 20MB of log file, near 100% utilization, no log cleaning
    run 2 - updates every record, creates another 20MB of log file, utilization falls, maybe to around 60%. No log cleaning yet, because the utilization is still above the 50% threshold.
    run 3 - updates every record, creates another 20MB of log file, utilization falls below 50%, log cleaning starts running, either in the background by the daemon thread, or because the app calls Environment.cleanLog(), without any need to set je.cleaner.forceCleanFiles.
    So the question here is (c) from above -- you're saying that your DbSpace utilization level doesn't match what you believe your application is doing. There are three possible answers -- your application has a bug :-), or with secondaries and whatnot, JE is representing your data in a fashion you didn't expect, or JE's disk space utilization calculation is inaccurate.
    I suggested using DbDump -r as a first sanity check of what data your application holds. It will dump all the valid records in the environment (though not in key order, no -r is slower, but dumps in key order). Keys and data should up on different lines, so the number of lines in the dump files should be twice the number of records in the environment. You've done this already in your application, but this is an independent way of checking. It also makes it easier to see what portion of data is in primary versus secondary databases, because the data is dumped into per-database files. You could also load the data into a new, blank environment to look at it.
    I think asked you about the size of your records because a customer recently reported a JE disk utilization bug, which we are currently working on. It turns out that if your data records are very different in size (in this case, 4 orders of magnitude) and consistently only the larger or the smaller records are made obsolete, the utilization number gets out of whack. It doesn't really sound like your situation, because you're updating all your records, and they don't sound like they're that different in size. But nevertheless, here's a way of looking at what JE thinks your record sizes are. Run this command:
    java -jar je.jar DbPrintLog -h <envhome> -S
    and you'll see some output that talks about different types of log entries, and their sizes. Look at the lines that say LN and LN_TX at the top. These are data records. Do they match the sizes you expect? These lines do include JE's per-record headers. How large that is depends on whether your data is transactional or not. Non-transactional data records have a header of about 35 bytes, whereas transactional data records have 60 bytes added to them. If your data is small, that can be quite a large percentage. This is quite a lot more than for BDB (Core), partly because BDB (Core) doesn't have record level locking, and partly because we store a number of internal fields as 64 bit rather than 16 or 32 bit values.
    The line that's labelled "key/data" shows what portion JE thinks is the application's data. Note that DbPrintLog, unlike DbSpace, doesn't account for obsoleteness, so while you'll see a more detailed picture of what the records look like in the log, you may see more records than you expect.
    A last step we can take is to send you a development version of DbSpace that has a new feature to recalculate the utilization level. It runs more slowly than the vanilla DbSpace, but is a way of double checking the utilization level.
    In my first response, I suggested trying je.cleaner.forceCleanFiles just to make it clear that the cleaner will run, and to see if the problem is really around the question of what the utilization level should be. Setting that property lets the cleaner bypass the utilization trigger. If using it really reduced the size of your logs, it reinforces that your idea of what your application is doing is correct, and casts suspicion on the utilization calculation.
    So in summary, let's try these steps
    - use DbDump and DbPrintLog to double check the amount and size of your application data
    - make a table of runs, that shows the log size in bytes, number of log files, and the utilization level reported by DbSpace
    - run a je.cleaner.forceCleanFiles cleanLog loop on one of the logs that seems to have a high utilization level, and see how much it reduces to, and what the resulting utilization level is
    If it all points to JE, we'll probably take it offline, and ask for your test case.
    Regards,
    Linda

  • Details about the PSD file of a mobile application

    I have some questions or blurry ideas about the use of photoshop to design mobile applications, in fact I have a problem to choose the resolution for the new file is what I take 72px / inch oubien 160px / inch or 240px / inch?
    the size of the screen of my working interface:
    Do I selected a standard size of the mobile 800 / 480px or I done the artwork for each mobile screen? also same question for tablets?
    I want to know all about mobile apps design

    please, is there anyone to guide me

Maybe you are looking for