LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-19-2017, 07:41 AM   #1
yogi89
LQ Newbie
 
Registered: Oct 2017
Posts: 7

Rep: Reputation: Disabled
Not able to ping hostname


Hi,

I am using redhat 7 via VM, the question is am able to ping the server using ip address and hostname within the server

[root@yogeshgowda ~]# ping 192.168.60.114
PING 192.168.60.114 (192.168.60.114) 56(84) bytes of data.
64 bytes from 192.168.60.114: icmp_seq=1 ttl=64 time=0.046 ms
64 bytes from 192.168.60.114: icmp_seq=2 ttl=64 time=0.045 ms

[root@yogeshgowda ~]# ping yogeshgowda
PING yogeshgowda (192.168.60.114) 56(84) bytes of data.
64 bytes from yogeshgowda (192.168.60.114): icmp_seq=1 ttl=64 time=0.043 ms
64 bytes from yogeshgowda (192.168.60.114): icmp_seq=2 ttl=64 time=0.046 ms

but if I use nslookup command am getting following error

[root@yogeshgowda ~]# nslookup yogeshgowda
;; connection timed out; trying next origin
;; connection timed out; no servers could be reached

and I am able to ping the ip address from windows but not with hostname
 
Old 10-19-2017, 08:00 AM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,242
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
This has to do with your search strings. Look at the FQDN. The server knows it's shortname and FQDN but windows maybe doesn't.
Try nslookup with it's FQDN if that doesn't resolve then you don't have an entry in DNS for the server.
 
1 members found this post helpful.
Old 10-19-2017, 08:09 AM   #3
yogi89
LQ Newbie
 
Registered: Oct 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks for the reply,

may i know what is FQDN.
 
Old 10-19-2017, 08:30 AM   #4
urbanwks
Member
 
Registered: Sep 2003
Distribution: Slackware64-Current, FreeBSD 11.0
Posts: 192

Rep: Reputation: 204Reputation: 204Reputation: 204
Quote:
Originally Posted by yogi89 View Post
may i know what is FQDN.
I think the first thing you need to do is research DNS - what it is, what itís for, how it works.
 
1 members found this post helpful.
Old 10-19-2017, 08:33 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179
For instance, the /etc/hosts file is a common way to define host-names, and this is probably where the name of your host was stored.

Otherwise, your server attempts to use the "DNS" service to resolve the domain-name. (As it did to resolve the domain-name, "linuxquestions.org.")

FQDN = Fully-Qualified Domain Name.

I am quite certain that the domain-name you seek should have been defined in the hosts-file, and that if you now put it there, your problem will go away.
 
1 members found this post helpful.
Old 10-19-2017, 08:35 AM   #6
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Quote:
Originally Posted by yogi89 View Post
Thanks for the reply,

may i know what is FQDN.
Hi yogi89 - Welcome to LQ.

FQDN is Fully Qualified Domain Name. Instead of just the short name "yogeshgowda", the FQDN would be "yogeshgowda.something.somethingelse", for example.

Good idea to read up on DNS as suggested above.

Cheers :-) !

Last edited by Rickkkk; 10-19-2017 at 08:36 AM.
 
Old 10-19-2017, 08:43 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,422

Rep: Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103
Fully Qualified Domain Name i.e google.com.

How did you configure networking for the VM? If nslookup can not access any servers then your VM might have a host only network and can not access the internet.

However, unless you add the VM hostname to the Windows hosts file or have local DNS service running you will not be able to ping computers on the LAN by hostname.
 
1 members found this post helpful.
Old 10-19-2017, 09:36 AM   #8
yogi89
LQ Newbie
 
Registered: Oct 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
I am new to the linux/unix env,,,,,, all I required is to ping my hostname (linux VM) from windows local server and "nslookup hostname" cmd to give the normal o/p, if it requires any snapshot from my side please let me know.
 
Old 10-19-2017, 09:40 AM   #9
yogi89
LQ Newbie
 
Registered: Oct 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
For instance, the /etc/hosts file is a common way to define host-names, and this is probably where the name of your host was stored.

Otherwise, your server attempts to use the "DNS" service to resolve the domain-name. (As it did to resolve the domain-name, "linuxquestions.org.")

FQDN = Fully-Qualified Domain Name.

I am quite certain that the domain-name you seek should have been defined in the hosts-file, and that if you now put it there, your problem will go away.
I have added my hostname and ip in /etc/hosts/ but still nslookup is not showing the desired o/p
 
Old 10-19-2017, 09:44 AM   #10
yogi89
LQ Newbie
 
Registered: Oct 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Fully Qualified Domain Name i.e google.com.

How did you configure networking for the VM? If nslookup can not access any servers then your VM might have a host only network and can not access the internet.

However, unless you add the VM hostname to the Windows hosts file or have local DNS service running you will not be able to ping computers on the LAN by hostname.
I didn't configured anything fro VM, I have only changed the hostname and added that hostname in /etc/hosts/ after that i am able to ping the hostname
 
Old 10-19-2017, 10:12 AM   #11
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Quote:
Originally Posted by yogi89 View Post
I didn't configured anything fro VM, I have only changed the hostname and added that hostname in /etc/hosts/ after that i am able to ping the hostname
Hi again yogi89 ... There is a field in the /etc/hosts file for the FQDN, as well as one for the short name. Did you enter both ?
 
Old 10-19-2017, 10:31 AM   #12
yogi89
LQ Newbie
 
Registered: Oct 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Rickkkk View Post
Hi again yogi89 ... There is a field in the /etc/hosts file for the FQDN, as well as one for the short name. Did you enter both ?
Hello rickkk,

thanks for ur patience to help out, here is what my /etc/hosts contains


[root@JKT ~]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.60.114 yogeshgowda yogeshgowda.mydomain.com
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@JKT ~]#
 
Old 10-19-2017, 11:35 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,422

Rep: Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103Reputation: 3103
It does not look like your VM network is configured to access the internet or you don't have any name servers in your /etc/reslov.conf file.

What is the desired output? nslookup queries the Domain Name System. Your VM hostname is not a real registered FQDN and therefore your only going to see something similar to the output below.

Quote:
nslookup myserver.localdomain
Server: 8.8.8.8
Address: 8.8.8.8#53

** server can't find myserver.localdomain: NXDOMAIN
What are you trying to accomplish?
 
Old 10-19-2017, 04:41 PM   #14
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,242
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
There are several things the OP can do:

1. Check and ensure that his DNS server has an entry for his linux box. If one is not present he needs to add it.

2. If he cannot add a DNS entry then he is going to have to add an enter to the host file on the windows box so it know what IP Address to use.

3. Just use the IP address to connect/talk to the linux box.

The question is which host are you editing the host file on? Linux or Windows? This needs to be done on the windows machine.

Also you should be aware that if you use a host file nslookup is not going top work as nslookup uses a DNS server to resolve its queries for which you do not have an entry.
Ping on the other hand will give you the correct ip address as it does look at the host file before DNS.
 
1 members found this post helpful.
Old 10-20-2017, 04:36 AM   #15
yogi89
LQ Newbie
 
Registered: Oct 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
It does not look like your VM network is configured to access the internet or you don't have any name servers in your /etc/reslov.conf file.

What is the desired output? nslookup queries the Domain Name System. Your VM hostname is not a real registered FQDN and therefore your only going to see something similar to the output below.



What are you trying to accomplish?
Problem is am not able browse in VM, and mailx is not working I dont know whether mailx is properly configured or not, I need to enable some scripts in cron which sends the o/p to my mail.

This is what my /etc/resolv.conf cotains.
[root@JKT ~]# more /etc/resolv.conf
# Generated by NetworkManager
search jktech
nameserver 202.138.96.2
nameserver 8.8.8.8


I'm trying into install progress database into my VM, before that I need to be sure with all the perquisites in VM server.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
FC13 install can ping by hostname, ssh by hostname fails jeffk42 Linux - Networking 4 11-14-2011 12:27 PM
BIND9 SLOW ping when ping by hostname dschuett Linux - Networking 10 02-02-2011 05:17 PM
Cannot Ping Hostname videoman Linux - Networking 4 02-07-2009 02:04 PM
Can't Ping By Hostname, Only By IP SoulGrind Linux - Networking 5 10-14-2006 12:28 AM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration