LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-03-2012, 02:15 PM   #1
hdc
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Rep: Reputation: Disabled
Unhappy host command hangs on my hostname


Hi guys!

First post here!
I've been reading these forums for help for quite some time and this time it was my turn to ask since I couldn't find anything online that could help me

So, I have setup a CentOS 6 VM with Oracle 11g and I was trying to access the Oracle's Database Control through my Windows machine.

It works on my Windows machine only if I type the IP of my VM (NAT network connection):
https://192.168.157.131:1158/em/cons...outApplication
In my VM, it works either way (centosvm01 is my VM machine/host name)
https://centosvm01:1158/em/console/aboutApplication
I cannot make it so the Windows side resolves the host name, and I was looking for some help on that.

Here are some outputs from my VM:
Code:
[root@centosvm01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#----
192.168.157.131   centosvm01 centosvm01.localdomain
Code:
[root@centosvm01 ~]# host centosvm01
;; connection timed out; trying next origin
Code:
[root@centosvm01 ~]# ping centosvm01
PING centosvm01 (192.168.157.131) 56(84) bytes of data.
64 bytes from centosvm01 (192.168.157.131): icmp_seq=1 ttl=64 time=0.055 ms
64 bytes from centosvm01 (192.168.157.131): icmp_seq=2 ttl=64 time=0.089 ms
^C
--- centosvm01 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1799ms
rtt min/avg/max/mdev = 0.055/0.072/0.089/0.017 ms
Code:
[root@centosvm01 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=centosvm01.localdomain
Please let me know if you guys need any other prints?

Thank you in advance for the help!
 
Old 08-03-2012, 03:05 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by hdc View Post
I cannot make it so the Windows side resolves the host name
That's not a Linux Networking question IMHO. Simplest way, if the guest connects in bridge mode and gets a static IP from the routers DHCPd, is to add it to your hosts equivalent of /etc/hosts.
 
Old 08-03-2012, 10:29 PM   #3
hdc
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
I know what you mean but the issue is on the Linux VM because I had a CentOS 5 setup (somebody installed for me) and it was working fine before (nothing was changed on the Windows end).

Also, as you can see from my comment, doing a "host centosvm01" command doesn't work which shows the issue is on the VM.
 
Old 08-06-2012, 09:55 AM   #4
hdc
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Anybody could shed some light please?
 
Old 08-06-2012, 10:28 AM   #5
Gleylancer
LQ Newbie
 
Registered: Aug 2012
Distribution: Slackware+RHEL
Posts: 24

Rep: Reputation: Disabled
Quote:
Originally Posted by hdc View Post
Code:
[root@centosvm01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#----
192.168.157.131   centosvm01 centosvm01.localdomain
The order for the /etc/hosts entries should be <IP> <HOSTNAME>.<DOMAIN> <ALIAS>, but it doesn't really matter.

Please try "nslookup centosvm01" on windows/dosbox and "resolveip centosvm01" and post what happens.

Last edited by Gleylancer; 08-06-2012 at 10:43 AM.
 
Old 08-08-2012, 12:54 PM   #6
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
host like nslookup need a DNS server providing this information to resolve the hostname. An entry in /etc/hosts won’t help here.

You can add an entry in C:\WINDOWS\system32\drivers\etc\hosts to use the hostname also on the Windows side.

If you want to go with DNS, you will need to setup a DNS server and point your Windows thereto to use it.
 
1 members found this post helpful.
Old 08-09-2012, 09:58 AM   #7
hdc
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yep! That fixed the issue.

Thank you for the help!
 
  


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
[SOLVED] hostname: Unknown host peterpan303 Linux - Newbie 4 11-11-2010 02:30 PM
Hostname: Unknown Host ?? I'm very confused Rampage2884 Linux - Networking 12 11-10-2010 07:18 AM
[SOLVED] hostname: Unknown host konzo Linux - Newbie 4 08-07-2010 02:43 PM
host hostname not working ? vinaytp Linux - Newbie 13 11-13-2009 05:28 AM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:15 PM.

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