LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LPD error - bad hostname RH7.3 (https://www.linuxquestions.org/questions/linux-newbie-8/lpd-error-bad-hostname-rh7-3-a-29615/)

KL2001 09-04-2002 09:58 PM

LPD error - bad hostname RH7.3
 
I have an epson color 880 that I had setup and working in RH7.3, but when I moved to school, I now get a hostname assigned when my computer logs onto the network (didn't have this setup on my home network). Now, I am trying to get my printer to work again, and I get:

[kl2001@{ip} kl2001]$ lpq
Get_local_host: hostname '**-***-***-***.xxx.xx.xxxxxxxx.xxx' bad
[kl2001@{ip} kl2001]$

I tried manually setting a hostname in my /etc/sysconfig/network file, but to no avail, just get the same error, but instead of my IP, I get my chosen hostname in the error.

I tried re-installing the printer (gui) before I typed lpq into the console and saw this error, as the gui doesn't report the error, just that it can't send data to the printer.

Any help would be appreciated.

Thank you in advance.

:Pengy:

DavidPhillips 09-04-2002 11:33 PM

sounds like you are trying to use an invalid name

KL2001 09-05-2002 12:13 AM

the hostname is assigned by the ISP... can I force a valid localhost somehow???

born4linux 09-05-2002 03:31 AM

run this command:

hostname

Then edit /etc/hosts and set you 127.0.0.1 line to this:

# this is just one line
127.0.0.1 localhost.localdomain localhost localhost output_of_the_hostname_command

Save the file and run this:

/sbin/service lpd restart

KL2001 09-05-2002 07:36 AM

great, it's working now, but won't I get the error again if I get assigned a different IP by my ISP??? is there a way to use wildcards to nake it so I don't have to re-do this each time I get a new IP?

DavidPhillips 09-05-2002 08:26 AM

the 127.0.0.1 will never change

KL2001 09-05-2002 11:09 AM

no, that won't, but the results from hostname will, which is assigned by my ISP, and consists of my IP plus thier domain (i.e. 192.168.122.255.charter.com)

DavidPhillips 09-05-2002 12:19 PM

bummer

try it like this

127.0.0.1 localhost.localdomain localhost localhost $HOSTNAME


I dont know if it will work but I guess it's worth a try

KL2001 09-05-2002 12:39 PM

No joy on the $HOSTNAME entry...looks like I will just have to change the file, or try to retain my IP address....

DavidPhillips 09-05-2002 03:42 PM

one other way is to have the file built like so

echo 127.0.0.1 localhost.localhost localhost $HOSTNAME > /etc/hosts


put the command in rc.local if you connect on boot if not run it as a script after connecting

KL2001 09-05-2002 05:32 PM

that looks like it might work, we'll see if it holds up when my ISP changes IPs


All times are GMT -5. The time now is 12:03 PM.