Announcement

Collapse
No announcement yet.

"unable to resolve host" error from /etc/hosts

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    "unable to resolve host" error from /etc/hosts

    As far as I can tell, this isn't causing me any real problems. But I noticed this error and am wondering what I've done wrong...

    hosts
    127.0.0.1 localhost.localdomain localhost
    127.0.1.1 office.smith.net office
    192.168.1 media.smith.net media
    192.168.1 hplaptop.smith.net hplaptop
    hostname
    office
    error
    sudo: unable to resolve host office

    Please Read Me

    #2
    Re: "unable to resolve host" error from /etc/hosts

    Network Configuration might be helpful?
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: "unable to resolve host" error from /etc/hosts

      Great guide, but no change here. Edited /etc/hosts to
      127.0.0.1 localhost
      127.0.1.1 office
      192.168.1 media.smith.net media
      192.168.1 hplaptop.smith.net hplaptop
      same error.

      Please Read Me

      Comment


        #4
        Re: "unable to resolve host" error from /etc/hosts

        Isn't 127.0.1.1 a 'sub-net' of localhost? Wouldn't the entry be:

        127.0.1.1 localhost office
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Re: "unable to resolve host" error from /etc/hosts

          no change - also tried removing localhost line and making office 127.0.0.1

          Please Read Me

          Comment


            #6
            Re: "unable to resolve host" error from /etc/hosts

            Does "office.smith.net" really exist? (no spelling errors, no hidden control characters in the string or the device?)
            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
            – John F. Kennedy, February 26, 1962.

            Comment


              #7
              Re: "unable to resolve host" error from /etc/hosts

              not outside my home network.

              changed it to

              smith

              only, still showing error.

              Not causing issues that I know of, I just thought if I had a bad hosts line I ought to fix it.

              Please Read Me

              Comment


                #8
                Re: "unable to resolve host" error from /etc/hosts

                I don't think it will change your current error, but is there any particular reason why the IP addresses of these entries only have 3 octets instead of 4?
                Code:
                192.168.1    media.smith.net media
                192.168.1    hplaptop.smith.net hplaptop

                Comment


                  #9
                  Re: "unable to resolve host" error from /etc/hosts



                  And they are the ones that work!
                  "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                  – John F. Kennedy, February 26, 1962.

                  Comment


                    #10
                    Re: "unable to resolve host" error from /etc/hosts

                    I'm positive that oshunluvr 'typeod' the IPs. They have to be his router IP, and he either forgot to add the last octect, or left it out deliberately.
                    Windows no longer obstructs my view.
                    Using Kubuntu Linux since March 23, 2007.
                    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                    Comment


                      #11
                      Re: "unable to resolve host" error from /etc/hosts

                      Originally posted by Snowhog
                      I'm positive that oshunluvr 'typeod' the IPs. They have to be his router IP, and he either forgot to add the last octect, or left it out deliberately.
                      No doubt, or they wouldn't have worked...
                      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                      – John F. Kennedy, February 26, 1962.

                      Comment


                        #12
                        Re: "unable to resolve host" error from /etc/hosts

                        AND (of course) it's totally unnecessary:
                        The IETF had designated a set of prefixes to be reserved for use with private networks. As a safe guard reserved prefixes will never be assigned to networks in the global internet...
                        Prefix Lowest Address Highest Address
                        ...
                        192.168/12 192.168.0.0 192.168.255.255
                        ...
                        EVERYBODY (well, almost) HAS A 192.168.*.* ADDRESS ON THEIR HOME NETWORK!

                        Comment


                          #13
                          Re: "unable to resolve host" error from /etc/hosts

                          Are you saying that 192.168.1 is the same as 192.168.1.*
                          "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                          – John F. Kennedy, February 26, 1962.

                          Comment


                            #14
                            Re: "unable to resolve host" error from /etc/hosts

                            127.0.1.1 office.smith.net office
                            I think this was hinted at above, but the way I see it "office.smith.net" is not localhost but "office" is. The correct syntax is IPaddress, name then alias, so shouldn't it be the other way around?

                            Comment


                              #15
                              Re: "unable to resolve host" error from /etc/hosts

                              @GreyGeek: If your question was directed to me, what I was saying was that there is no need to truncate (or otherwise obfuscate) a 192.168.*.* address, because it is COMPLETELY LOCAL to a home (or business) net. By convention, the internet ignores such addresses, because there are (quite literally) tens of thousands of duplicates of them. There are a couple of other such address strings, as well: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 169.254.0.0 to 169.254.255.255. Routers are hardwired not to pass them on outside the local net. See Comer's book about TCP/IP or Tanenbaum's book about Computer Networking. I once took a (tax deductible) professional development course on the subject.
                              [/quote]

                              I'm well aware of everything you write about the 192.* and 10.* address ranges. The question at hand was if "192.168.1" was a valid address in the /etc/hosts file. If it is I wasn't aware of it and I've learned something. But, my gut feeling is that only 3 octets is erroneous.

                              Rute.pdf has a nice section on all this stuff.

                              Comment

                              Working...
                              X