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 04-06-2011, 01:34 PM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Rep: Reputation: 60
Cannot ping via hostname Ubuntu 10.10 VM


I have a Windows 7 machine that I have an installation of Ubuntu 10.10 via VMware and am having an issue with pinging by hostname thorugh the VM. From the Windows 7 machine I can ping by name without any issue but not with the VM. I have the VM as bridged so it is pulling all the network stuff via DHCP including the correct DNS servers. I can ping all the DNS servers and host without any issue. I have verified my /etc/resolv.conf entries are all correct. If I run nslookup via the VM it says:

PHP Code:
server cannot find abdc1SERVFAIL 
I have also verified that AVAHI is running to cache the DNS stuff and still no success. Any Suggestions?

Last edited by metallica1973; 04-06-2011 at 01:37 PM.
 
Old 04-06-2011, 02:41 PM   #2
Walter.Stroebel
LQ Newbie
 
Registered: Apr 2011
Location: Arnhem, The Netherlands
Distribution: CentOS
Posts: 19

Rep: Reputation: 6
Can it be you have a firewall active on the Windows machine?
Are you pinging just a hostname or a fully qualified name? abdc1 or abdc1.some.domain?
Is there a "search" line in /etc/resolv.conf and does it make sense?
Try "dig abdc1" instead of nslookup.
If you start nslookup without any arguments, you should enter interactive mode and it should tell you the nameserver it is using.
You can try another name server by entering "server ip_address"
For instance, server 8.8.8.8 or server 8.8.4.4 to use Google's public name servers.

Something in the above should help you resolve (no pun intended) the problem.
 
Old 04-06-2011, 02:48 PM   #3
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
thanks for the reply

I can nslookup outside let say google.com but I cannot resolve hostname locally. I ran a dig against a FQDN and no errors

QUERY 1 ANSWER 1 AUTHORITY 0 ADDITIONAL 0

IPTABLES -nvL is not running. No firewall is running on this VM.

I thought that it may have been something in the /etc/nsswitch.conf since it is using AVAHI

Name Service Switch Configuration

The order in which your system selects a method of resolving hostnames to IP addresses is controlled by the Name Service Switch (NSS) configuration file /etc/nsswitch.conf. As mentioned in the previous section, typically static hostnames defined in the systems /etc/hosts file have precedence over names resolved from DNS. The following is an example of the line responsible for this order of hostname lookups in the file /etc/nsswitch.conf.
PHP Code:
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
hosts
:          files dns [NOTFOUND=return] mdns4_minimal mdns4 
it did nothing

Last edited by metallica1973; 04-06-2011 at 03:34 PM.
 
Old 04-06-2011, 02:51 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Add them to
Code:
/etc/hosts
Kind regards

Last edited by repo; 04-06-2011 at 02:54 PM.
 
Old 04-06-2011, 03:23 PM   #5
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
Can an IP be "Blacklisted" from a DNS server? It is strange how the Windows 7 machine hosting the VM machine can do DNS queries without any issues but the VM which is bridged and has it static ip address cannot. I can query the DNS servers via dig, nslookup. I cannot nmblookup a FQDN but can query via dig and nslookup? I am stumped. I thought I had those entries in /etc/hosts but will check again.

Last edited by metallica1973; 04-06-2011 at 03:35 PM.
 
Old 04-06-2011, 03:47 PM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Are these names locally?
Windows uses netbios and wins.
Perhaps that's why windows can resolve them, and linux can't.

Kind regards
 
Old 04-06-2011, 03:56 PM   #7
timdvtemp
Member
 
Registered: Feb 2011
Distribution: Redhat/Fedora
Posts: 39

Rep: Reputation: 3
For local machine names, the file
Code:
/etc/hosts
should look similar to your
Code:
XXX/system32/etc/drivers/hosts
file in windows.
 
Old 04-06-2011, 04:12 PM   #8
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
There are several hundred hosts. To have to put them into the host file would take me forever. ?

I can reverse look up the DNS server using nslookup but ping the host by hostname

Can I add the DNS server name and IP in the /etc/hosts is that what you mean?

Last edited by metallica1973; 04-06-2011 at 04:20 PM.
 
Old 04-06-2011, 04:22 PM   #9
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Take a look at
http://www.colingodsey.com/resolving...amba-in-linux/

Kind regards
 
Old 04-06-2011, 04:49 PM   #10
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
Thanks for the reply, been there done that with /etc/nsswitch.conf

Ok I made progress.

I looked at the /etc/resolv.conf and there wasnt a search entry present only nameserver ip_address
I added that back to the /etc/resolv.conf and now all is well accept I cannot ping FQDN?
So for example I can ping abcd1 but not abcd1.testnetwork.local

So in my /etc/resolv.conf I have

search localhost testnetwork.local
nameserver 1.2.3.4
nameserver 5.6.7.8
??

P.S

excellent references for the newbies like myself:

http://www.linuxhomenetworking.com/w...onfiguring_DNS

It appears that I need a Domain testnetwork.local in my /etc/resolv.conf and that will allow me to ping a FQDN withing the domain.

I also looked into AVAHI and the /etc/nsswitch.conf to look at the order of the DNS queries such as:

PHP Code:
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4 
But all is all everything seems ok. I still need to test that domain entry to see if I can ping the FQDN.

Thanks for all the help.

Last edited by metallica1973; 04-06-2011 at 05:23 PM.
 
  


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

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

All times are GMT -5. The time now is 04:34 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