/etc/hosts entries ignored

My Mac Pro, OSX 10.5.8, is ignoring entries in the /etc/hosts/ file. I have been all over the net and not found the definitive solution to this for 10.5.8
I know that 10.5.8 does not use /etc/resolv.conf in the expected way, so adding at the top of resolv.conf the line 'order hosts/bind' does not work.
This is a super handy trick for the work I do (I do lots of conversions and migrations of websites and databases) and I have come to depend on my Mac resolving from the hosts file first, before going on to normal DNS.
Any pointers would be very helpful.
-Bosco

That is probably because the *NetInfo Manager* application is no longer used. I use host file entries for ad blocking (in Snow Leopard, too), and it works just fine.
The OP may have improper entries or is doing something like using a text file with non-Unix line endings, but without further feedback it is hard to say.

Similar Messages

  • /etc/hosts.deny ignored

    Hey all!
    I've tried to secure my sshd by running denyhosts (http://www.archlinux.org/packages/search/?q=denyhosts).
    denyhosts works perfectly and adds alot of adresses to /etc/hosts.deny
    But my system ignores /etc/hosts.deny: I still got my sshd-logs full of connections from the same IP.
    Don't worry, I've tried it with my PC: same result.
    I've added my IP by hand: same result.
    Why is my /etc/hosts.deny ignored? What can I do?
    Regards,
    Moritz

    i.e.
    Sep 1 20:38:10 linux sshd[9343]: Invalid user brand from 219.254.35.183
    Sep 1 20:38:13 linux sshd[9345]: Invalid user client from 219.254.35.183
    Sep 1 20:38:16 linux sshd[9347]: Invalid user corp from 219.254.35.183
    Sep 1 20:38:19 linux sshd[9349]: Invalid user content from 219.254.35.183
    Sep 1 20:38:21 linux sshd[9351]: Invalid user contact from 219.254.35.183
    Sep 1 20:38:24 linux sshd[9353]: Invalid user coach from 219.254.35.183
    Sep 1 20:38:27 linux sshd[9355]: Invalid user career from 219.254.35.183
    Sep 1 20:38:30 linux sshd[9357]: Invalid user chat from 219.254.35.183
    Sep 1 20:38:33 linux sshd[9359]: Invalid user dibalo from 219.254.35.183
    Sep 1 20:38:36 linux sshd[9361]: Invalid user download from 219.254.35.183
    Sep 1 20:38:39 linux sshd[9363]: Invalid user complainst from 219.254.35.183
    Sep 1 20:38:42 linux sshd[9365]: Invalid user sales from 219.254.35.183
    Sep 1 20:38:45 linux sshd[9367]: Invalid user email from 219.254.35.183
    Sep 1 20:38:48 linux sshd[9369]: Invalid user emails from 219.254.35.183
    but
    # grep 219.254.35.183 hosts.deny
    # DenyHosts: Fri Jun 30 11:46:20 2006 | ALL: 219.254.35.183
    ALL: 219.254.35.183

  • /etc/hosts is ignored

    I configured my computer to use tor and dnsmasq to resolve dns queries exactly how the arch wiki said to. This seems to work fine, however, when I try to add a entry into /etc/hosts it is ignored. To fix this I tried commenting out no-resolv but it did no good. Why is it ignoring my /etc/hosts file?
    Here is my /etc/hosts file:
    # /etc/hosts: static lookup table for host names
    #<ip-address> <hostname.domain.org> <hostname>
    127.0.0.1 localhost.localdomain localhost
    ::1 localhost.localdomain localhost
    0.0.0.0 facebook.com
    # End of file
    Facebook.com still works...
    Last edited by SteveDeFacto (2013-12-21 21:20:47)

    WonderWoofy wrote:If you are using dnsmasq, why not just put it in your dnsmasq.conf?  The formatting will obviously be different, but if that is what is resolving the dns, it would make more sense to put it there.
    Actually, the main reason I was trying to modify /etc/hosts is because I am wanting to build a decentralized peer-to-peer service. I need to redirect the user to localhost upon entering a url with ".mydomain" The only way I can think to do this is to add an entry into /etc/hosts.
    I just happen to be using tor/dnsmasq so my thought is that modifying /etc/hosts won't always work for people with abnormal dns configurations. I would like to understand why it is not working more than just finding a work around.

  • /etc/hosts is ignored by everything

    Here is the current `/etc/hosts`
    # 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
    255.255.255.255    broadcasthost
    ::1        localhost
    fe80::1%lo0    localhost
    # couchapps
    127.0.0.1    projects board
    I've tried all the possible solutions:
    restarts
    resetting it to "factory state"
    clearing browser cache
      (ping and curl have no caches, but they also ignore it)
    dscacheutil -flushcache
    sudo chmod 664 /etc/hosts
    sudo chown root:wheel /etc/hosts
    Nothing. Only the `localhost` is working.
    No idea why.

    The question is answered!
    the blame goes to old orthodox line-breaks (CR)
    i've switched to Unix-style (LF) and it's fine.
    // SublimeText2 Menu: View –> Line Endings –> Unix

  • /etc/hosts file ignored

    I'm having a strange problem with the hosts file
    I've edited my hosts file so I can work with a local machine for testing.
    The entry in the hosts file is honoured for about 30 seconds or for as long as I ping it.
    As soon as I stop pinging it, it reverts to the DNS entry and ignores etc/hosts
    If I then touch hosts, it wil honour the entry again for 30 odd seconds.
    Any ideas?

    When it reverts to the DNS entry, I'm not 100% sure DirectoryService is making a request out to our DNS servers or if it's cached somewhere, but it's certainly not using what's in hosts.
    Wow, this is odd. WRT DirectoryService making requests, you can use the "dscacheutil" command to look at syscall stats. This utility will track cache hits, cache misses and external calls for each standard system call it monitors. So, you care about gethostbyname(), so by periodically running dscacheutil, then doing name lookups (i.e. with ping or whatever), you can see where the system is getting the data. You'd want to run something like this:
    dscacheutil -statistics | grep gethostbyname

  • /etc/hosts entries

    Hi, I'm just starting to look at a 10.4.10 server (intel dual-core xenon). All this server does is run Zimbra. I've noticed the person who set it up made some changes to the /etc/hosts file and was wondering what effect these changes could have on the system. Here is the hosts file. I've also noticed that PID 0 kernel_task is running at about 75% CPU ALL the time!!
    # Host Database
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    127.0.0.1 hostname.company.com mail.company.com localhost mail hostname
    255.255.255.255 broadcasthost
    ::1 localhost
    192.168.1.265 mail.comapny.com hostname.company.com localhost mail hostname
    Thanks for any help.
    Pat.

    The first few lines of the hosts file should be...
    # Host Database
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    Pat.

  • How to add a host entry in ipad

    I need to add a /etc/hosts entry on an ipad like we do in unix. Is it possible?

    Point your DNS configuration to a local one in which you can add all tue IP aliases that you dream of.

  • Pacman ignores /etc/hosts

    I use csslayer-aur-repo which is placed on googlecode.com server, however csslayer-aur-repo.googlecode.com sometimes returns IP of server which doesn't seem to have csslayer-aur-repo.db.tar.gz file. As a workaround i've put csslayer-aur-repo.googlecode.com in /etc/hosts with an IP which works just fine. I've tested it with wget and ping, and both of them seem to use this "new" IP address. However pacman seems to ignore /etc/hosts and picks that random IP which mostly leads to "404 not found" error when doing pacman -Syu/Syy/Sy.
    Here is my /etc/hosts
    # /etc/hosts: static lookup table for host names
    #<ip-address> <hostname.domain.org> <hostname>
    127.0.0.1 localhost.localdomain localhost Archie
    209.85.135.82 csslayer-aur-repo.googlecode.com
    # End of file
    and here is the repo entry from pacman.conf:
    [csslayer-aur-repo]
    Server = http://csslayer-aur-repo.googlecode.com/files

    Yup, wget fetches http://csslayer-aur-repo.googlecode.com … .db.tar.gz just fine and it uses the IP specified in /etc/hosts.
    Surely pacman does not deploy its own DNS server, but seems to ignore /etc/hosts. If i remove csslayer line from /etc/hosts then wget also will fail.
    [hash@Archie ~]$ wget http://csslayer-aur-repo.googlecode.com/files/csslayer-aur-repo.db.tar.gz
    --2010-07-26 18:54:29-- http://csslayer-aur-repo.googlecode.com/files/csslayer-aur-repo.db.tar.gz
    Translacja csslayer-aur-repo.googlecode.com... 209.85.135.82
    Łączenie się z csslayer-aur-repo.googlecode.com|209.85.135.82|:80... połączono.
    Żądanie HTTP wysłano, oczekiwanie na odpowiedź... 200 OK
    Długość: 1190 (1,2K) [application/x-gzip]
    Zapis do: `csslayer-aur-repo.db.tar.gz'
    100%[=============================================================================================================================================================================>] 1.190 --.-K/s w 0,02s
    2010-07-26 18:54:30 (72,5 KB/s) - zapisano `csslayer-aur-repo.db.tar.gz' [1190/1190]
    [hash@Archie ~]$ pacman -Syu
    :: Synchronizing package databases...
    kde-unstable is up to date
    core is up to date
    extra is up to date
    community is up to date
    error: nie udało się pobrać pliku 'csslayer-aur-repo.db.tar.gz' z csslayer-aur-repo.googlecode.com : Not Found
    error: failed to update csslayer-aur-repo (Not Found)
    Last edited by hash (2010-07-26 16:55:47)

  • Entries in /etc/hosts are being ingored.

    I added 
    209.132.176.175 bugzilla.gnome.org
    to /etc/hosts and restarted Xserver, network service and my pppoe connection.
    And the entry in /etc/hosts is is being ignored. Any idea how to debug this weird behavior?

    Ah, now I see what your problem is :-)
    What if you ping bugzilla.gnome.org? Does that reach 209.132.176.175?
    -edit-
    It seems that Firefox simply doesn't use /etc/hosts at all. Solution (if don't want to wait for your DNS servers to get updated): install dnsmasq, cp /etc/resolv.conf /etc/resolv.conf.2, change nameserver in resolv.conf to 127.0.0.1, change resolv-file to resolv.conf.2 and add bugzilla.gnome.org to address field in dnsmasq.conf and start /etc/rc.d/dnsmasq. You'd have to make sure ppooe doesn't overwrite resolv.conf (it'd have to write to resolv.conf.2). Additional benefit: local caching of DNS queries (=> faster browsing).
    Last edited by lucke (2007-10-21 23:23:42)

  • Entry in /etc/hosts.allow for insecure VNC?

    I read the ssh wiki article which teaches to add an entry to /etc/hosts.allow for sshd.  I am know that tunneling vnc through sshd is the way to go security wise, however, there are cases where I need to switch on un-encrypted vnc for the purposes of sharing my X11 session with family members.  Anyway, my question deals with an entry in the /etc/hosts.allow for gnome's desktop sharing (which is vnc as I understand it).  Does anyone know the syntax to allow vnc for any incoming connection (default port of 5900).
    I have tried:
    vino: ALL
    Xvnc: ALL
    X11vnc: ALL
    None of which worked.
    Thanks!

    when I don't know what's the name of the process listening to specific port, I always execute
    netstat -tnlp
    to get the proper processes' names.

  • Sshd ignores /etc/hosts.allow and /etc/hosts.deny

    Hello everyone,
    I've just found out that sshd ignores /etc/hosts.allow and /etc/hosts.deny completely on my machine. It doesn't make use of tcp_wrappers. I am using the standard Arch package. Either my settings are wrong, or this is a severe security problem. It was a terrible surprise to find out that my server is under severe dictionary attacks all the time, despite the denyhosts script I am using.
    These are my settings:
    /etc/hosts.deny:
    ALL: ALL
    /etc/hosts.allow:
    # some nfs daemons: 192.168.1.0/255.255.255.0
    sshd sshd1 sshd2: ALL EXCEPT /etc/hosts.evil
    mysqld: 192.168.1.0/255.255.255.0
    /etc/hosts.evil:
    195.113.21.131
    60.10.6.53
    A simple experiment to verify the settings:
    [root@charon etc]# tcpdmatch -d -i /etc/xinetd.conf sshd 195.113.21.131
    warning: sshd: no such process name in /etc/xinetd.conf
    client: address 195.113.21.131
    server: process sshd
    matched: hosts.deny line 5
    access: denied
    [root@charon etc]# tcpdmatch -d -i /etc/xinetd.conf sshd 195.113.21.130
    warning: sshd: no such process name in /etc/xinetd.conf
    client: address 195.113.21.130
    server: process sshd
    matched: hosts.allow line 10
    access: granted
    This seems to be fine. But when I go to the machine 195.113.21.131, I can simply log in with no trouble at all.
    This is really strange. Does it have something to do with the xinetd warning? I am not using xinetd... Maybe I'm doing something wrong. If you have experienced such a trouble, please give me a hint.

    elasticdog wrote:So should our package not have the ListenAddress 0.0.0.0 line uncommented by default?  My guess would be that since it listens on all local addresses by default, we're just overwriting that when specifying 0.0.0.0, which isn't valid.  That was users don't have to specify their local IP address.  Unless I'm wrong, shouldn't this be a bug/feature request for the packager?
    This doesn't seem to be a package bug... IMHO, sshd must respect all the settings in hosts.deny and hosts.allow, regardless the IP address it listens on. The behaviour I noticed seems to be much more complicated. Basic settings (daemon name mentioned in hosts.*) worked, as far as I didn't want a "per IP" configuration. For example, including the daemon in hosts.allow really enabled remote connections, but any closer specifications (subdomains, EXCEPT operator...) were ignored. Access was simply granted without further evaluation. Excluding sshd from hosts.allow worked as one would assume. When I specified ListenAddress, everything started to work properly. This is mysterious. There are millions of computers using tcp wrappers and ssh, so it's hard to believe there could be a bug.

  • Strange entry in the /etc/hosts file

    Hi,
    While doing some testings with my network this afternoon, I noticed that there's this strange line in my /etc/hosts file:
    ::1 localhost
    Anybody has any idea what the "::1" is for? The only thing related to network that I had recently installed is VPN Tracker. Could it be VPN Tracker that added that line to the hosts file?
    Thanks in advance for your help!
    Frank
    PowerBook G4   Mac OS X (10.4.8)  

    It's supposed to be there, here's a fresh install's complete hosts file...
    # 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
    255.255.255.255 broadcasthost
    ::1 localhost "
    Not sure what it means... may be a 16 bit number though! :-D

  • /etc/hosts...blank entries

    Hi,
    i m having one production and one its DR (machine is Sun Fire E6900). Now on the production machine today i checked the entries in the /etc/hosts file...totally blank, not even a single character inside it. Now i cann't restore it from the legato networker it says permissions denied. We must recover from the host itself. But i am unable to run the nwrecover utility from the host as it needs GUI mode, which i am unable to access using xbrowser/xstart applicaiton from my laptop.
    Another thing, i copied all the entries from the DR site and pasted inside the /etc/hosts file in the Production site. But it still didn't work.
    Now, i would appreciate if any one having any solution regarding the restoration of /etc/hosts file.
    Mehdi

    When you say pasting entries into it didnt work.
    What do you mean?
    Were you using an editor like vi?
    What errors did you recieve.

  • Leopard: /etc/hosts is ALWAYS ignored

    Hi all. I can't seem to find an answer to this anywhere on the net. Can anyone tell me why, in Leopard, my /etc/hosts file would be completely ignored. It doesn't matter what I put in it, it seems to never be read. I've tried using dnscacheutil to empty the cache and all that. Nothing seems to help. And I can't find anywhere how I can tell Leopard the order in which to try hostname lookups (hosts first, then DNS). Any ideas?
    Thanks
    --Dan

    can you post your /etc/hosts file, or a subset (maybe replace IP addresses with nn.nn.nn.nn).
    If you use
    file /etc/hosts
    do you see
    /etc/hosts: ASCII English text
    or
    /etc/hosts: ASCII text, with CR line terminators
    or
    /etc/hosts: ASCII text, with CRLF line terminators
    Have you tried to install and/or run your own DNS server on your Mac?

  • Asking for a password when trying to add an entry to /etc/hosts

    I am trying to add an entry to /etc/hosts using Terminal. When I type the command: sudo nano /etc/hosts it asks me for a password. I have never set a password so I have no idea what this would be. My admin pw is blank (I just hit enter) and this is not working. Is there a defaut password or how can I reset this? Thanks

    This would be your admin account password. You must set one.
    Forgot Your Account Password
    For Lion, Mountain Lion, or Mavericks
        Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
         When the menubar appears select Terminal from the Utilities menu.
         Enter resetpassword at the prompt and press RETURN. Follow
         instructions in the dialog window that will appear.
         Or see Reset a Mac OS X 10.7 Lion Password, OS X Mountain Lion- Reset a login password,
         and OS X Lion- Apple ID can be used to reset your user account password.
    For Snow Leopard and earlier with installer DVD
         Mac OS X 10.6- If you forget your administrator password
    For Snow Leopard and earlier without installer DVD
        How to reset your Mac OS X password without an installer disc | MacYourself

Maybe you are looking for

  • Reports Available in SAP

    Hi All, I have below two requirement , is there any report available in sap which fullfills my below requirement 1) Report for outstanding commitments Is there any repoert available which shows outstanding commitments related to the purchase orders 2

  • Line chart - help please

    Hi, I have a line chart that shows project gate based on the date. 1)Is it possible to give same color for the project gates? (p-12 Gate4,p-12 Gate5) 2)Is it possible to change legend shapes for different project gate in crystal reports (manually i a

  • After I updated the latest iso 6.0.1 my speaker is  problem

    After I updated the latest iso 6.0.1 my speaker is  problem. Only the upper one and all the rest is working  good ( loud speaker and headset). Just only the one I put on the ear. Please help !!!!

  • Need help on my 40 gigabyte ipod photo and possible deletion of songs

    Hi... I may have to reinstall all of my windows xp system software due to a potential virus. I currently cannot get to my desktop and therefore online. So, here's the dilemma...if I have to redo my harddrive, I will lose itunes, and wipe out all of t

  • 2014 ford f150 bluetooth sync and iphone 8.1.2 OS compatibility issues

    Bluetooth does not see my phone, Ford motor company itself has flagged this as an issue, why can't two excellent companies resolve an important customer service issue?