Announcement

Collapse
No announcement yet.

[Solved]renamed computer now unable to resolve host

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

    [Solved]renamed computer now unable to resolve host

    I was trying share a printer on another xp pc from my linux box. I renamed the linux box from h-kubuntu to hkub to shorten the name and now adept won't start and konsole gives me "sudo: unable to resolve host hkub".

    I have no clue of how to resolve this. How do I get out of this mess?
    Harold<br />Kubuntu 8.04<br />Mepis 7.0 &amp; 8.0<br />Mint 5 KDE

    #2
    Re: renamed computer now unable to resolve host

    check /etc/hosts.conf

    Mine renamed my computer when I did the upgrade
    Scott<br />K-Ubuntu 8.04 KDE4

    Comment


      #3
      Re: renamed computer now unable to resolve host

      I am not able to do anything as root or sudo.

      I can look at the files about host in /etc/ but am not able to change anything because I can't edit them as root in dolphin.

      This is what host.conf says: "# The "order" line is only used by old versions of the C library.
      multi off"

      hostname has this: "hkub"

      the hosts file has this:
      127.0.0.1 localhost
      127.0.1.1 h-kubuntu

      # 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
      ff02::3 ip6-allhosts
      hosts.allow is all commented out as well as hosts.deny.

      Is there a way to log in from the boot menu as single like in some other distros?
      Harold<br />Kubuntu 8.04<br />Mepis 7.0 &amp; 8.0<br />Mint 5 KDE

      Comment


        #4
        Re: renamed computer now unable to resolve host

        You need to change

        127.0.1.1 h-kubuntu

        to

        127.0.1.1 hkub

        (as you probably guessed).

        As for how to actually edit them, well

        1) This is one reason why ubuntu's idea of locking the root password is BAD. It's rather easy to break sudo and thus lock yourself out of your machine. If you have a real root password you need only worry about forgetting it.

        but it's easily fixed. As you suggested, if you press Esc when booting to enter the grub menu(you need to keep your eye's open as there's like a 3 sec window to do it in, and if you do it too early you'll often end up in the bios instead), there should then be a 'recovery mode' or similar, that will give you the option to go into a root shell. Then you should be able to fix your hosts file.

        If that fails, you'll have to use a LiveCD. Mount your drive (for example on /media/hda1), and then change the hosts file in /media/hda1/etc/hosts. You may need to be root on the live system.
        I am running Ubuntu 8.10 (yes Gnome) with upgrades applied daily about 0900 UK time. Hardware is Dell Precision 420, 2x 800 MHz PIII, 512 MB RDRAM, nVidia GeForce 6800 128 MB AGP graphics, 18GB SCSI and 500GB IDE HDDs, DVD burner, Hauppage TV card.

        Comment


          #5
          Re: renamed computer now unable to resolve host

          Thanks, cantab. Your information worked fine. I was not able to hit the ESC key at the right time and work in the shell. Working quickly in the shell is not a strong point of mine anyway.

          I used the live cd and edited the hosts file and now I am able to get back into adept.

          Thanks so much for your help.
          Harold<br />Kubuntu 8.04<br />Mepis 7.0 &amp; 8.0<br />Mint 5 KDE

          Comment

          Working...
          X