Debian command-line cannot resolve host [closed] - linux

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 months ago.
Improve this question
I'm having an issue where my remote command-line cannot resolve the local hostname. It doesn't show as user#localhost, user#ip or any variant, but instead as user#(none):
Using username "rogue".
rogue#<my-ip>'s password:
Linux (none) 3.13.7-x86_64-linode38 #1 SMP Tue Mar 25 12:59:48 EDT 2014 x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Apr 27 15:34:56 2014 from ---
rogue#(none):~$
Any proceeding commands cause this warning message:
rogue#(none):~$ sudo service nginx start
sudo: unable to resolve host (none)
[sudo] password for rogue:
Looking at my hosts and hostname files, I'm not seeing anything out of the ordinary:
/etc/hostname
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
/etc/hosts
127.0.0.1 localhost
127.0.1.1 debian
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
What could potentially be wrong with my network configuration? If possible, I would like that it says user#my.domain, but I need localhost to still route correctly to 127.0.0.1

Your /etc/hostname is very wrong.
It should be plain text of FQDN, like example.com or localhost, instead of a similar copy of /etc/hosts
You may want to use command hostname to view and set hostname, man it

What about these commands?
hostname here.yourhost.name
sudo sed -i "s|localhost|localhost $(hostname)|g" /etc/hosts
adding hostname next to other, localhost names in /etc/hosts

Related

Problem starting oracle XE on linxu after succesfull configure

I have installed Oracle XE on linux mint, but it won't start.
when I do:
sudo /etc/init.d/oracle-xe-18c start
I get this back:
Starting Oracle Net Listener.
Starting Oracle Database instance XE.
Oracle Database instance XE started.
Failed to start Oracle Net Listener using
/opt/oracle/product/18c/dbhomeXE/bin/tnslsnr and Oracle Database
/opt/oracle/product/18c/dbhomeXE/bin/sqlplus.
Oracel configured without errors after I added localhost th /etc/hosts.
Now hosts look like this:
127.0.0.1 localhost
127.0.1.1 ksb-Latitude-E6420
# 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
127.0.0.1 localhost.localdomain localhost
How can I trouble shoot this?
I can't find any logfile.
BR Kresten

gpinitsystem unknown host mdw

I am sure that there are no extra spaces before or after your hostname(S) in the host file, and using ssh mdw can connect to mdw.
The /etc/hosts is like this:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
The error log:
20161209:21:01:14:030310 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, please wait...
20161209:21:01:14:030310 gpinitsystem:mdw:gpadmin-[INFO]:-Reading Greenplum configuration file /home/gpadmin/gpconfigs/gpinitsystem_config
20161209:21:01:14:030310 gpinitsystem:mdw:gpadmin-[INFO]:-Locale has not been set in /home/gpadmin/gpconfigs/gpinitsystem_config, will set to default value
20161209:21:01:14:030310 gpinitsystem:mdw:gpadmin-[INFO]:-Locale set to en_US.utf8
20161209:21:01:15:030310 gpinitsystem:mdw:gpadmin-[INFO]:-MASTER_MAX_CONNECT not set, will set to default value 250
20161209:21:01:15:030310 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, Completed
20161209:21:01:15:030310 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, please wait...
.20161209:21:01:17:gpinitsystem:mdw:gpadmin-[FATAL]:-Unknown host mdw Script Exiting!
please.
How many hosts there are in your greenplum. Your /etc/hosts doesn't contain any information about mdw and sdw.
Assume you have two hosts named mdw and sdw1 in your greenplum, both of the /etc/hosts files should be like this:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.31.25.24 mdw
172.31.16.170 sdw1
Replace the ip and host name with your own. Before try gpinitsystem again, you'd make sure you have performed gpssh-exkeys succesfully.
UPDATE:
I helped him with this issue using Skype. The answer is that his gpadmin account had no privilege to call ping utility, cause gpinitsystem calls ping to ensure any host in the DBMS exists.

DB2 instance creation failed while running db2icrt

I have installed DB2 10.5 server in my centos 7 VM.
I am trying to create a DB2 instance via running db2icrt
./db2icrt -u db2fenc1 db2inst1
But the command fails by issuing this :
Operating system information: Linux 3.10.0-229.el7.x86_64.#1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64
ERROR: The host name "vm65x148.acg.ips" is invalid. Specify a valid host name.
ERROR: The "db2icrt" command failed. Ensure the command parameters are valid,
that errors reported in the log file are fixed, then rerun the command.
The entry in my /etc/hosts file is this
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
I assume that vm65x148.acg.ips is the hostname of your machine. Make sure that this hostname can be resolved on the OS level, then try creating the instance again.
for more detail, see http://www-01.ibm.com/support/docview.wss?uid=swg21615752
As pointed out in the post by Peter Schuetze ,my /etc/hosts file was missing the entry of my VM id . So I tried to fix the issue by editing my /etc/hosts files
This is the initial entry in my /etc/hosts file
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
This is how it looked after editing
127.0.0.1 vm65x148.acg.ips localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
After that I restarted the daemon like this :
/etc/rc.d/init.d/network restart
Then I tried to create the DB2 instanceand this time it worked
Hope this helps someone else

What is the correct /etc/hosts format?

Recently I am started having issue with /etc/hosts file on hadoop nodes. Each host has private & public IP.
Some of the previous setup was with the following format
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.3.62 client01.dev.abc.com client01
and new hosts with following format
127.0.0.1 client01.dev.abc.com localhost.localdomain localhost
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
I am still confuse with it. Any help ?
Thanks
just do
nano /etc/hosts
and then add these below the lines which are already present,
192.168.1.15 hadoop-master
192.168.1.16 hadoop-slave-1
192.168.1.17 hadoop-slave-2
These IP addresses should be local/Private addresses.

Host name not being resolved properly in CentOS

I am running CentOS on a virtual machine. My /etc/hosts file is as follows:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.50.17 192-168-50-17.openstacklocal 192-168-50-17
192.168.50.13 slave5
/etc/resolv.conf:
; generated by /sbin/dhclient-script
search openstacklocal
nameserver 192.168.50.3
nameserver 8.8.8.8
nameserver 8.8.4.4
All pings are working properly. However, when I am trying to run the following command -
/usr/lib64/lustre/tests/llmount.sh, this is what I am getting:
Loading modules from /usr/lib64/lustre/tests/..
detected 1 online CPUs by sysfs
libcfs will create CPU partition based on online CPUs
debug=vfstrace rpctrace dlmtrace neterror ha config ioctl super lfsck
subsystem_debug=all -lnet -lnd -pinger
Formatting mgs, mds, osts
Format mds1: /tmp/lustre-mdt1
Format ost1: /tmp/lustre-ost1
mkfs.lustre: Cannot resolve hostname '192-168-50-17#tcp'.
mkfs.lustre: exiting with 1 (Operation not permitted)
I am running it as the root user. Any help on fixing this would be appreciated. Thanks!
Why does your /etc/hosts file have what looks like an IP address with dashes (-) instead of dots (.)? You probably just need to delete these lines from the (or the entire) /etc/hosts file.

Resources