Bad Hostname Error In Linux
Contents |
PaDocsMga contactHangoutsMas higit pa mula sa GoogleMag-sign inMga nakatagong fieldHanapin ang mga pangkat o mensahe
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this unable to resolve host linux site About Us Learn more about Stack Overflow the company Business Learn sudo unable to resolve host debian more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
Sudo Unable To Resolve Host Raspberry Pi
x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why https://groups.google.com/d/topic/www-mechanize-users/oF9nF865iBg sometimes I am getting a bad hostname? up vote 1 down vote favorite This is something really bizarre. We have a Shell script, that is to do server configuration on every Linux box. and it contains this line of command: #!/bin/bash ... hostname=`hostname -f 2>/dev/null` Most of time, this line of script returns back the correct host name value, as: + hostname=xyz.companyname.com But I http://stackoverflow.com/questions/39630110/why-sometimes-i-am-getting-a-bad-hostname have seen couple of times, the whole configure fails, because it gives back such output: + hostname=xyz.companyname.COM I don't know why the last piece of domain name becomes UP-Case value. I don't see anything suspicious in the /etc/hosts file. Any idea what could make such happen ? Thanks, Jack linux hostname system-administration share|improve this question asked Sep 22 at 4:10 user3595231 323 add a comment| 1 Answer 1 active oldest votes up vote -1 down vote Check /etc/hosts. My understanding is that hostname -f can retrieve the hostname from DHCP (?) or /etc/hosts—based on what condition(s), I don't know. But you may have a 123.45.67.89 xyz.companyname.com xyz.companyname.COM or something similar in there. share|improve this answer answered Sep 22 at 4:20 Andrew Cheong 15.1k93478 Thanks for the message. Other than this, is there any other way to trigger this behavior ? Our IT guy claims no one would do such in this file "/etc/hosts". –user3595231 Sep 26 at 17:21 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Pa
Wireless Info Link Monitoring with RRDTool router config Linux Wireless Router Smoothwall Info site search Custom Search Resolving a Bad Hostname Error in Net::SMTP Perl Module This page describes how I debugged some issues being http://martybugs.net/linux/net-smtp.cgi experienced with the Net::SMTP perl module, and how the issue was eventually resolved. Background Information http://serverfault.com/questions/155797/hostname-f-says-hostname-the-specified-hostname-is-invalid-guess-why Web Environment I have a photography blog hosted on a shared linux webserver in a data centre, and one of the features it supports is email notification whenever someone leaves a comment. The blog is coded in Perl, and uses the Net::SMTP perl module to send the email notifications. When calling the Net::SMTP module, I specify the hostname of unable to a mailserver that it uses to send the email. It's important to note that the mailserver is in a different data centre than the webserver (ie, the mailserver software is not running on the same box as the webserver software). Symptoms of the Issue In the past few weeks, I had noticed that occasionally I wouldn't receive an email when someone left a comment. A friendly visitor emailed me recently, to let me know unable to resolve that he tried to leave a comment, he saw a "500 Internal Server Error" page after submitting the comment. His comment had been saved, but the email notification had failed, and the code on the webserver that was attempting to send the email notification had failed, causing the 500 error. A check of the apache error log on the webserver showed: [Sun Sep 21 08:53:39 2008] [error] [client a.b.c.d] Can't call method "auth" on an undefined value at /path/blog/plugins/feedback line 897,
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top hostname -f says “hostname: the specified hostname is invalid”. Guess why? up vote 2 down vote favorite hostname -f says "hostname: the specified hostname is invalid". The hostname (FQDN) specified in /etc/hostname is also listed in /etc/hosts and is pingable. No actual DNS server yet of the host knows. Is this a reason of the error reported or something else? (the OS is Ubuntu 10.04 Server). Update: registering the host at a DNS server (so that the name can be successfully resolved via Internet) did not help. ubuntu domain-name-system hostname hosts share|improve this question edited Jun 30 '10 at 6:49 asked Jun 29 '10 at 4:45 Ivan 1,205103156 1 Well... what's the contents of /etc/hostname or do we need to guess that too? –rodjek Jun 29 '10 at 5:06 Please share the contents of your /etc/hostname and /etc/hosts. Maybe the hostname is in fact invalid. –David Jun 30 '10 at 7:34 add a comment| 4 Answers 4 active oldest votes up vote 8 down vote From this thread on Ubuntu Forums. Apparently the underscore is an illegal character for hostnames. I had one in my hostname, and it gave me your failure message. Maybe you're getting something similar. share|improve this answer answered Nov 6 '12 at 16:56 user128952 8111 add a comment| up