/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

Similar Messages

  • /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 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.

  • The new entries made in /etc/hosts file is not picked up by Weblogic.

    Hi All,
    I have come across a scenario where i have changed the IP address of a particular host name (which was already present in etc/hosts) to point to a new IP address.
    After i did this change, when i do a telnet test to the same hostname, i can see it is getting connected to the new IP to which i changed. But my service which is deployed on weblogic 10.0 still keeps sending requests to the old IP which i commented in the etc/hosts file instead of the new IP address.
    My question is will weblogic cache the data in etc/hosts file somewhere?
    Thanks in anticipation..
    Madhu

    Application deployed on weblogic server will pick the IP address of the server on which the application is deployed .
    IP address or listen address for weblogic server can be configured in 3 different ways :
    Listen Address : Blank --- This means that the server will listen to all the interfaces available on the Machine .
    Listen Address : IP address or Hostname --- The server will listen only to the specified IP address or the hostname .
    Listen Address : : localhost --- The server will be listening only on localhost address and will not be accessible remotely .
    Please check what it the listen address specified at you end.
    Thanks,
    Sandeep

  • Editing etc\hosts file on windows xp for apps. problem post installation.

    Hi all,
    I was able to install 11.5.10.2 apps on my win xp prof machine. During that process I had to edit the etc/hosts file in windows directory as a work around for that domain name field during installation. Also added the primary DNS suffix as 'suneel.com' . I gave the domain name as 'suneel.com' during installation. The RapidWiz is taking localhost as the system name and referring to this system as localhost.suneel.com, though the actual system name is 'websoft-xp' .
    The host file on Apps machine has the following entries:
    127.0.0.1 localhost
    127.0.0.1 localhost.suneel.com suneel.com
    127.0.0.1 websoft-xp.suneel.com
    So when I connect to apps login server from other systems in lan, I've to edit their hosts file and add an entry for localhost.suneel.com to point to its ip address or else the apps throws an error after logging in as operations/welcome using a different url say 192.168.1.4:8000 . Is there a way to get around this issue?
    More over I'm not able connect to VIS db from other systems. The oracle clients give an error 'No listner' at this address. (The original listener was listening at localhost.suneel.com:1521). So I tried to create a new listerner from Net Manager that actually listens at websoft-xp (the real system name) but it throws me an error 'A valid log file is required' while saving the network configuration and prevents me from saving the network configuration.
    Did I do something wrong with the hosts file during installation or did i miss any entries in that file thats causing this? Any solutions for the above problems will be appreciated?
    Thanks
    Suneel
    Message was edited by:
    suneelgv

    Well I tried that option but for some reason it didn't work for me. It kept giving the tns:connection closed error. Then I searched in metalink and found this note : Note:333158.1
    It suggested setting tcp.validnode_checking = no
    in sqlnet.ora. in
    F:\oracle\visdb\9.2.0\network\admin\VIS_websoft-xp
    And it works. Hope this helps someone facing a similar problem. Good luck.
    BTW how do I run autoconfig?
    Thanks,
    Suneel Gundlapalli

  • Blocking Ad servers via etc/host file not working

    In Snow Leopard I add a list of ad servers and direct them to 127.0.0.1 via the /ect/host file.
    I've configured the host file on my mac mini server and it doesn't work.
    i just want to block ads when using browsers ON the Mini.
    How can I achieve this?

    Yeah; that's an old-time Windows and Unix hack.
    There are ad-blocking extensions for all major web browsers, and those are easier to manage and maintain.
    Off the top, I'd have to check the search order to see if I was getting a response from remote DNS or from /etc/hosts here.
    If you're running a Mac OS X Server box, you're hopefully also running DNS services, and if you're running DNS services, then that's going to be where this hackery gets implemented. Add bogus zones. And if DNS gets an answer from its cache, I wouldn't tend to expect it to go read /etc/hosts (for performance reasons), for that matter.
    There may well be an ad-blocking DNS server around you can forward queries to, too; I haven't looked for that.
    If you make changes to your local /etc/hosts setup, try issuing the following to clear the cache:
    dnscacheutil -flushcache
    I'd recommend installing an ad-blocker. /etc/hosts is an old-school approach and can end up causing weirdnesses on errors, particularly if your box is (also) a DNS server for your LAN. (Also realize that Apple isn't documenting the /etc/hosts file in the Mac OS X Server 10.6 networking manual.)

  • How to use /etc/hosts file

    how to get Mac OS "X" 10.6.x to use /etc/hosts file and/or /etc/resolv.conf file(s) (ala Unix-style); instead of using some other mechanism?

    I 'thought' that SnowLeopard (somewhere in the "Support" arena) told me that 10.6 (SnowLeopard) did NOT use /etc/hosts, but I am corrected, and now understand through a number of replies here (Apple-Support-Discussions) and other responses that SnowLeopard (10.6 (I'm at 10.6.7) DOES USE /etc/hosts... - AND YES _ I'm attempting to prevent some things, and have some web-site-development-things go to a local-server, etc. etc. etc. - but - I guess my 'answer' was supplied by a number of people and that my ...nix background and my familiarity with /etc/hosts is fine and working well...
    thanks to one and all who helped! - I'm now also well-acquainted with dscl, dscacheutil, and other such utilities...
    THANKSSSSS!!!!!!!

  • Do I need to provide the physcial hostname to iAS during installation or can I just that installed name into the /etc/hosts file?

     

    Hi,
    Pls confirm if you are using Windows 2000 Pro, in this O/S the
    hostname is the name of the computer itself. Check the
    MyComputer->Properties->Network Identification->Properties, the name you
    find under the computer name will be automatically taken while
    installation, if it doesn't then there is some error. However the
    C:\Winnt\System32\Drivers\Etc\hosts doesn't matter much while installing
    iAS 6.0 SP1 or above. Hope this helps
    Regards
    Raj
    Hazel Seow wrote:
    Do I need to provide the physcial hostname to iAS during installation
    or can I just that installed name into the /etc/hosts file?
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Make nslookup read /etc/hosts file

    Dear,
    OS: OUL5x64
    my nslookup resolve the name thru dns server.
    question :
    how to make nslookup resolves name through /etc/hosts file.
    i do have /etc/resolv.conf and /etc/nsswitch.conf file
    here is my nsswitch.conf
    /etc/nsswitch.conf
    #hosts: db files nisplus nis dns
    hosts: files
    but it never uses the file to resolve the name.
    how can i force it to read /etc/hosts file first
    Thanks in advance!

    Perhaps it would help to elaborate on WHY you want nslookup to use the /etc/hosts file?
    If you look at the the name of the nslookup utility, it quite probably is an abbreviation of "nameserver lookup". That strongly suggests it is a tool for querying nameservers.
    NOT a tool to debug the name lookups of your operating system.
    On the platforms I use (I don't use HPUX), you can query and set the nameserver nslookup uses. I would consider it a bug if the nslookup tool uses /etc/hosts if set in nsswitch.conf.
    this is how I lookup what server is set for the utility:
    $ nslookup
    serverDefault server: 10.0.1.1
    Address: 10.0.1.1#53this is how nslookup responds to a query:
    nu.nlServer:        10.0.1.1
    Address:     10.0.1.1#53
    Non-authoritative answer:
    Name:     nu.nl
    Address: 62.69.184.53
    Name:     nu.nl
    Address: 62.69.179.198(I don't know how the "jive quote" comes in, it is supposed to be a "bigger than" sign)

  • Solaris10.. need to remove "::1 localhost" from /etc/hosts file

    I know i have IPV6 disabled (through install options) but i still see "::1 localhost" entry in the /etc/hosts file.. This is related to localhost with IPV6 address ::1.. why it is still there.. what is it's impact.. how can i remove it if i decide to remove..
    Thanks, appreciate help.
    S.

    It could be there if you linked /etc/hosts (or /etc/inet/hosts to /etc/inet/ipnodes). Or recreated the hosts-file from ipnodes (or it could be there by default and removed by my jumpstart, which means i would be unaware of it :-)
    And no, you don't need it if you are not running IPv6, in fact removing it will eliminate a few error messages.
    On all non-IPv6 systems i install i link /etc/inet/ipnodes to /etc/inet/hosts, in order to eliminate errors when changing IP addresses of the host and odd resolv-conflicts (which also removes any reference to ::1), and so far i have never experienced any issue with that.
    .7/M. x2000 :)

  • 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

  • Which localhost line shuold be used in the /etc/hosts file on Solaris Sparc

    Hi There,
    I would like to know which line should be use in the /etc/hosts file:
    127.0.0.1 localhost
    127.0.0.1 localhost.localdomain localhost
    Thanks :-)
    J

    user560159 wrote:
    Hi There,
    I would like to know which line should be use in the /etc/hosts file:
    127.0.0.1 localhost
    127.0.0.1 localhost.localdomain localhost
    Thanks :-)
    JThe format for the hosts file is
    ipaddress alias1 alias2 alias3 alias4 Most shops will just have two aliases, one with just the machine name, one with the fully qualified domain.machine name. In reality, you can do whatever makes sense:
    [root@vmlnx01 ~]# cat /etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality wil fail
    127.0.0.1       localhost.localdomain localhost
    [root@vmlnx01 ~]# ping localhost
    PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
    64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=1.96 ms
    [root@vmlnx01 ~]# ping localhost.localdomain
    PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
    64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.094 ms
    [root@vmlnx01 ~]# vi /etc/hosts
    <<<< adding an alias 'fred' >>>>>
    [root@vmlnx01 ~]# cat /etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality wil fail
    127.0.0.1       localhost.localdomain localhost fred
    [root@vmlnx01 ~]# ping fred
    PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
    64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.306 ms
    64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.093 ms
    64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.092 msDoes the order of the aliases have any meaning? I leave that quick experiment as an exercise for the student.

  • How could a java process bypass etc\hosts file while doing dns lookup ?

    Hi,
    I am developing a java web proxy and developer tool [http://www.tcpcatcher.org|http://www.tcpcatcher.org] .
    Right now it is working as a none transparent web proxy.
    In some situation and for some hosts, I would like to turn it into a transparent web proxy.
    Suppose, user's browser and java proxy are running on same host (typically on localhost). An entry is added in etc\hosts file, for example:
    127.0.0.1 google.com
    So without any change in browser config , if user visits google.com with its browser , http request is received at proxy level.
    Now my proxy has to get the actual ip address of google.com bypassing the etc\hosts file (right now the proxy is doing a loop on itself).
    Any idea how this could be achieved ?
    Am I searching in wrong direction ?
    thanks !

    This is a shot in the dark, but I'll try anyway.
    Take a look at dnsjava (open source, I never played with it).
    My understanding is that using this to resolve names instead of normal Java API's would allow you to bypass etc/hosts in the java code
    (see [http://old.nabble.com/DNS-Resolve-from-hosts-file-first-then-DNS-Server-td15431381.html]).

  • Is SID allowed to show up in /etc/hosts file?

    Experts:
    I am looking into a /etc/hosts which has something I never saw before.
    Every entry in that /etc/hosts file has a format as follows:
    123.23.456.678 CHERRY CHERRY.RIO.COM SID CHERRY.BRAVO.NET
    For example:
    123.23.456.678 CHERRY CHERRY.RIO.COM PRO CHERRY.BRAVO.NET
    Observation:
    0) WHY SID (here is PRD) gets into the hosts file? Would it cause some issues?
    1) each entry has 2 aliases ;
    2) "nslookup CHERRY.RIO.COM "
    2a) will return the correct IP address IF I run this nslookup on the server
    2b) will say "non-exist domain" on my PC
    3) "nslookup CHERRY.BRAVO.NET"
    3a) will say "non-exist domain" IF I run nslookup on the server
    3b) will give the correct IP address on my PC
    Thank you for help.

    Hi,
    If your system in domain than the entries look like below
    192.192.192.192    prdserver        prdserver.na.jjjjjjj.com 
    Prd server is an host name where your SAP application is running/installed &    prdserver.na.jjjjjjj.com is a hostname  in domain
    Thnaks
    Karan

  • Can SID show up in /etc/hosts file?

    Experts:
    I am looking into a /etc/hosts which has something I never saw before.
    Every entry in that /etc/hosts file has a format as follows:
    123.23.456.678   CHERRY      CHERRY.RIO.COM  SID  CHERRY.BRAVO.NET
    For example:
    123.23.456.678   CHERRY      CHERRY.RIO.COM  PRO  CHERRY.BRAVO.NET
    Observation:
    1) each entry has 2 aliases ;
    2) "nslookup CHERRY.RIO.COM "
          2a) will return the correct IP address IF I run this nslookup on the server
          2b) will say "non-exist domain" on my PC
    3) "nslookup CHERRY.BRAVO.NET"
          3a)  will say "non-exist domain"  IF I run nslookup on the server
          3b) will give the correct IP address on my PC
    4) WHY SID (here is PRD) gets into the hosts file?  Would it cause some issues?
    Thank you for help.

    Hi,
    The nslookup is trying to resolve the address via the DNS. If you are not using a DNS, you cannot resolve this hostname via your local machine.. In order to do that, you should add the entry to your local hosts file.
    I don't think there is any harm in using aliasses in that way, but it looks rather strange though..
    Ask your system administrator why the setup of the hosts file is like this. He is responsible for this..
    Kind regards,
    Mark

Maybe you are looking for

  • My macbook wants me to update OSX 10.8.5. When I attempt to do this it says: "updates are already in progress". (104)?

    My macbook pro wants me to update my OSX 10.8.5 and when I attempt to do this it says error updates are currently being updated (104)? I am not or have not updated anything recently so don't know why it is doing this?

  • Currency local is not correct and USD is correct

    Hi One of the user facing issue with currency, when fetches from excel adins, where usd is correct and local not. How to troubleshoot issue? Thanks

  • Code formatting problem

    Is the code formatting buggy or is it just that I cannot seem to find the correct mix of settings? I hope it is the latter and that someone here may know how to get it After setting the settings I think I want I get a simple SQL formatted like this.

  • Repaint in Java application (not Applet)

    Hi, I have server application with GUI containing TextArea. On any connection request from client, the application creates a thread which deals with the client request. Once the client request finishes, I want to show the detail of the client which c

  • Changing Budget Profile

    Hi Experts, After creating a project in CJ20N and then saving it, I need to change the budget profile. However after opening the project again the budget profile was greyed up and it did not allow me to change the budget profile. I hope someone can a