Entry in /etc/host file not working

6,293

All of you are absolutely correct. The ip of the server was changed. After updating the new IP , I am able to ping and connect by browser. Thank you so much .

Share:
6,293

Related videos on Youtube

Akshay
Author by

Akshay

Updated on September 18, 2022

Comments

  • Akshay
    Akshay almost 2 years

    I am facing an issue when I make the entry

    192.168.32.56 example.org
    

    in /etc/hosts file ,it does not work. But when I remove it , it starts working. Below is my /etc/hosts file for Ubuntu 16 . I also changed the permissions of hosts file to 777, then also its not working. A few days back it was working but it stopped now.

    # BEGIN hosts added by Network Connect
    192.0.47.198  access-dc.example.org
    # END hosts added by Network Connect
    127.0.0.1       localhost
    127.0.1.1       icanw42slpc2666
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    
    # LA 
    192.168.32.56  example.org
    
    # DC
    #192.168.47.56  example.org
    
    • Akshay
      Akshay over 4 years
      when I do ping example.org it does not respond. Also when I go to browser and then type example.org , the page does not come up.
    • Stephen Kitt
      Stephen Kitt over 4 years
      Does ping 192.168.32.56 work?
    • Akshay
      Akshay over 4 years
      PING example.org (192.168.32.56) 56(84) bytes of data. ^C --- example.icann.org ping statistics --- 253 packets transmitted, 0 received, 100% packet loss, time 258046ms
    • muru
      muru over 4 years
      So the hosts entry is working (see it says example.org (192.168.32.56)). If the host on that IP doesn't respond, adding entries to /etc/hosts isn't going to change anything.
    • Akshay
      Akshay over 4 years
      ping 192.168.32.56 does not work.
    • Stephen Kitt
      Stephen Kitt over 4 years
      Yes, that’s what we’re saying: since you can’t reach the host, nothing in /etc/hosts can help you. Since example.org is being resolved to 192.168.32.56, the entry in /etc/hosts itself is working — the only purpose of /etc/hosts is to provide name resolution. Network connectivity is another problem.
    • Akshay
      Akshay over 4 years
      people on windows are able to do it.. why not from linux? Also it was working before some time for me as well on linux
    • Panki
      Panki over 4 years
      This has absolutely nothing to do with Linux or Windows. A windows system can't ping an address it can't reach either.
    • roaima
      roaima over 4 years
      Put the permissions of the file back to the correct value