LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-25-2004, 02:19 PM   #1
angustia
Member
 
Registered: Apr 2003
Location: chile
Posts: 58

Rep: Reputation: 15
sudo gethostbyname() error


Thanks in advance.

I've got debian and wanted to allow user to reboot or poweroff, and tried sudo. The first problems were understanding the syntax, i think i got it. Now it's going on this:

#####as simple user######
rod@rod-deb:~$ sudo /sbin/reboot
sudo: unable to lookup rod-deb.localdomain via gethostbyname()
rod@rod-deb:~$ sudo /sbin/reboot
sudo: unable to lookup rod-deb.localdomain via gethostbyname()
rod@rod-deb:~$ sudo /sbin/reboot
sudo: unable to lookup rod-deb.localdomain via gethostbyname()...
many times until suddenly seems to connect and reboot.

No idea what could it be, so here are some files:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

User_Alias MORTALES = rod, leda

# Cmnd alias specification

Cmnd_Alias APAGADO = /sbin/poweroff, /sbin/reboot

# User privilege specification

MORTALES rod-deb =NOPASSWD:APAGADO

root ALL=(ALL) ALL


/etc/hostname:
rod-deb.localdomain

/etc/hosts:
### etherconf DEBCONF AREA. DO NOT EDIT THIS AREA OR INSERT TEXT BEFORE IT.

127.0.0.1 localhost
::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

127.0.0.1 rod-deb

### END OF DEBCONF AREA. PLACE YOUR EDITS BELOW; THEY WILL BE PRESERVED.

/etc/network/interfaces
### etherconf DEBCONF AREA. DO NOT EDIT THIS AREA OR INSERT TEXT BEFORE IT.
auto lo eth0

iface lo inet loopback

iface eth0 inet dhcp
hostname rod-deb

### END OF DEBCONF AREA. PLACE YOUR EDITS BELOW; THEY WILL BE PRESERVED.
 
Old 03-25-2004, 03:39 PM   #2
souljah
Member
 
Registered: Feb 2004
Location: New York City
Distribution: Debian
Posts: 97

Rep: Reputation: 15
apparently you need to fix your hostname to either a FQDN (fully qualified domain name) or properly specify your pseudo domain in your /etc/hosts (and possibly in your sudoers file). Either way you should fix your hostname.

either man'ing hostname or hostname --help should hook you up with some help.
 
Old 03-26-2004, 08:53 AM   #3
angustia
Member
 
Registered: Apr 2003
Location: chile
Posts: 58

Original Poster
Rep: Reputation: 15
done:

/etc/resolv.conf:
search mshome.net
nameserver 192.168.0.1

/etc/hostname:
rod-deb.mshome.net # getting internet from a XP machine

/etc/hosts:
127.0.0.1 localhost
::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

127.0.0.1 rod-deb.mshome.net rod-deb

ifconfig:
eth0 Link encap:Ethernet HWaddr 00:E0:18:99:64:08
inet addr:192.168.0.55 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:335 errors:0 dropped:0 overruns:0 frame:0
TX packets:395 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:179580 (175.3 KiB) TX bytes:75351 (73.5 KiB)
Interrupt:21

visudo:
# Host alias specification

Host_Alias LOCAL = 192.168.0.55

# User alias specification

User_Alias MORTALES = rod, leda

# Cmnd alias specification

Cmnd_Alias APAGADO = /sbin/poweroff, /sbin/reboot

# User privilege specification

MORTALES LOCAL =NOPASSWD:APAGADO

root ALL=(ALL) ALL

thanx
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
gethostbyname() error jnusa Programming 0 01-12-2005 04:56 AM
Sudo User Error ! LinuxRam Linux - Security 6 08-28-2004 10:03 PM
sudo: unable to lookup via gethostbyname() rickenbacherus Linux - General 2 12-07-2003 03:09 PM
gethostbyname error for aimstr8 Linux - Security 7 03-09-2002 04:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration