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 07-14-2015, 03:01 PM   #16
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625

I'll second those firsts.
 
Old 09-16-2015, 07:36 PM   #17
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by mpaf View Post
Hi,

This is 10 years later and still stumbling upon this thread. Thanks to Fravadona for her excellent answer, regards,

Miguel
Agreed, now 10.5 years later. It's never too late to learn something.
 
Old 01-29-2016, 05:12 AM   #18
syedwaheedz
LQ Newbie
 
Registered: Jan 2016
Posts: 2

Rep: Reputation: Disabled
there is workaround available for this on redhat support

https://access.redhat.com/solutions/46767
 
1 members found this post helpful.
Old 01-29-2016, 09:39 AM   #19
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831

Original Poster
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Yep but it is simpler to use the "getent ahosts <hostname>" suggested above as it requires no additional configuration.

My original question was caused by the fact that HP-UX modified their version of "dig" to resolve from local files based on nsswitch.conf settings but as noted long ago that is not part of the "dig" as provided by the folks that made it as part of BIND.

Amazing after all these years this thread is still getting hits.
 
Old 04-27-2016, 09:29 AM   #20
unixadm28
LQ Newbie
 
Registered: Sep 2009
Posts: 2

Rep: Reputation: 0
Hi Folks,

Same issue on CentOS 6.7

# getent host server28.example.com
> 12.13.14.15 server28.example.com server28

# host server28.example.com
> Host server28.example.com not found: 3(NXDOMAIN)

# host 12.13.14.15
> Host 12.13.14.15.in-addr.arpa. not found: 3(NXDOMAIN)

# /etc/hosts
12.13.14.15 server28.example.com server28

# /etc/nsswitch.conf
> hosts: files dns


cat /etc/resolv.conf
# Generated by NetworkManager
search example.com
nameserver 1.2.3.44
nameserver 1.2.3.55


Now its the application OSAD/jabberd/xmpp that is highly sensitive to FQDN resolving and it is not connecting due to failed DNS resolution.

so i do not have a control over how to tell application to use 'genet'.

the work around link: https://access.redhat.com/solutions/46767 recommended by 'syedwaheedz' doest help as I do not have the support with redhat so can't really see what the work around is?



Any help is highly appreciated!
 
Old 04-27-2016, 01:01 PM   #21
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831

Original Poster
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
The work around involves setting up dnsmasq on the local host and telling it to resolve from /etc/hosts.

I can't post what RedHat wrote but if you do a Google search for dnsmasq and /etc/hosts you'll find hits talking about this for other distros like Ubuntu that you should be able to adapt to your CentOS setup.

This link talks about how to install dnsmasq:
http://magicofubuntu.blogspot.com/20...e-dnsmasq.html
 
1 members found this post helpful.
Old 09-30-2016, 07:43 AM   #22
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
Thread is marked as Solved but still open. Does closing a thread require mod intervention? If so, triggering this comment to catch moderators' attention, might want to close
 
Old 07-19-2019, 10:12 AM   #23
ernesvega
LQ Newbie
 
Registered: Jul 2019
Posts: 1

Rep: Reputation: Disabled
Talking thanks

Thank you guys for all the unselfish work. I have read it through and even today is a relevant interesting topic.

Ernesto
 
Old 07-19-2019, 01:41 PM   #24
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by MensaWater View Post
Entries in my /etc/hosts file on a RedHat AS 3.0 installation are not being resolved when I use nslookup. (Also when I use "dig" or "host" utilities.)
Essentially the versions of nslookup, dig and host in the "bind" package are using dns only. That's what they are distributed with and that's what they do.
Other implementations of those commands may work differently (i.e. in NIS(+)
 
Old 07-19-2019, 01:47 PM   #25
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831

Original Poster
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by ehartman View Post
Essentially the versions of nslookup, dig and host in the "bind" package are using dns only. That's what they are distributed with and that's what they do.
Other implementations of those commands may work differently (i.e. in NIS(+)
This thread is fourteen years old. In fact when someone posted an answer after it was seven years old (oddly enough about seven years ago) I posted the thing about HP-UX' nslookup having been configured to read hosts but most other implementations not doing that.

If you're going to respond to a thread, especially an ancient one, you ought to look through the entire thread to see if the solution is already there. The other poster today was just thanking everyone for having posted before.

Last edited by MensaWater; 07-19-2019 at 01:50 PM.
 
Old 01-10-2020, 06:11 AM   #26
dvo
LQ Newbie
 
Registered: Jun 2007
Posts: 2

Rep: Reputation: 0
Lightbulb getent is a good solution

Even almost 15 years later the reply by Fravadona was very helpful to me - thanks a lot!
I've run into the problem several times already, and most replies I found online just stated that nslookup won't do it - what a constructive response.
Using instead, e.g., ping with a timeout is not really nice.

Meanwhile I've put the solution in a one-line script called getipaddr:
Code:
   getent ahosts $1 | head -n 1 | awk '{ print $1 }'
such that I can easily use it, e.g., in ~/.ssh/config:
Code:
  ProxyCommand nc -X connect -x 194.145.60.1:9400 `getipaddr %h` %p
such that the connect command can resolve also host name aliases in /etc/hosts
 
Old 03-04-2022, 02:42 AM   #27
Steph_J_6128
LQ Newbie
 
Registered: Mar 2022
Posts: 1

Rep: Reputation: 0
Cool

17 years laters, I just suscribed to thank you all !
See you in 3 years to celebrate de 20 years of this thread
 
Old 09-22-2022, 09:02 AM   #28
paulinuz
LQ Newbie
 
Registered: Sep 2022
Posts: 1

Rep: Reputation: 0
dig: parse of /etc/resolv.conf failed

Hi,

I have a W10 machine running Ubuntu 20.045/WSL and I am trying to test out nslookup, host, and dig commands. First, it suggested that I run "sudo apt install net-cools," which I did. But when I try to run "dig @127.0.0.1 google.com" or "dig --help" I get the error, "dig: parse of /etc/resolv.conf failed." Any ideas on what to do? Thanks.
 
  


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
Dig, host, nslookup? gsibble Arch 2 01-25-2015 03:36 AM
(nslookup) vs (dig and host) emailssent Linux - Networking 7 10-06-2004 08:38 AM
nslookup + dig commands ptreves Linux - General 8 09-10-2004 02:46 AM
dig, nslookup rpm ashley7 Linux - Software 0 04-05-2004 08:27 AM
DIG / NSLOOKUP message? matrx88 Linux - Networking 1 08-20-2003 12:15 AM

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

All times are GMT -5. The time now is 03:13 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
Open Source Consulting | Domain Registration