Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-26-2014, 03:57 AM   #1
LQ Newbie
Registered: Nov 2011
Posts: 7

Rep: Reputation: Disabled
local ip resolving taking time due to /etc/resolv.conf

I'm facing an issue in local ip resolving due to resolv.conf. if i remove /etc/resolv.conf local ip resolving is happening fastly but internet connectivity will not happen as resolv.conf is not available for DNS resolution.

My Local IP is on which I will do corba communication & is my DNS server ip.

I created /etc/resolv.conf in below way:
user$cat /etc/resolv.conf
# Generated by Connection Manager
domain localhost5.localdomain5

/etc hosts in below way:
user$cat /etc/hosts localhost.localdomain localhost localhost5.localdomain5 localhost5
::1 localhost6.localdomain6 localhost6

when i do corba communication on, communication will becoming slow as is taking time for resolving. when i remove /etc/resolv.conf corba communication will become fast, i feel in this situation, resolving is not taking time as there is no /etc/resolv.conf.

I'm attaching strace log of my binary which will use for corba communication

In the log you will being used instead of corba ip you will see lot of Timeouts in polling also. Donno why all these things are happening

i tried nameserver,search also in /etc/resolv.conf for but nothing helped me

i want local ip & external sites resolving both should happen fastly through /etc/resolv.conf.

how i can do the same

route table looks like below:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default UG 0 0 0 eth0.7 * U 0 0 0 eth2 * U 0 0 0 eth0.3 * UH 0 0 0 eth0.3 * U 0 0 0 eth0.4 * U 0 0 0 eth0.5 * U 0 0 0 eth0.6 * U 0 0 0 eth0.7 * UH 0 0 0 eth0.7 * UH 0 0 0 eth0.7 * U 0 0 0 eth0.8 * U 0 0 0 eth1
Attached Files
File Type: txt localhost4.txt (170.6 KB, 16 views)

Last edited by NagaManjunath; 03-26-2014 at 09:27 AM.
Old 03-26-2014, 09:46 AM   #2
Senior Member
Registered: Aug 2009
Distribution: CentOS
Posts: 3,683

Rep: Reputation: 1599Reputation: 1599Reputation: 1599Reputation: 1599Reputation: 1599Reputation: 1599Reputation: 1599Reputation: 1599Reputation: 1599Reputation: 1599Reputation: 1599
In file /etc/nsswitch.conf, what is the "hosts:" line? You want "files" to be checked before "dns"
Sorry. Too hasty. Ignore that.

Last edited by rknichols; 03-26-2014 at 09:58 AM. Reason: too hasty
Old 03-26-2014, 09:54 AM   #3
LQ Newbie
Registered: Nov 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi rknichols,

I tried /etc/nsswitch.conf with below changes already, but no help
hosts: files dns

if i delete my default gateway like below:

route delete default gw

some times resolving is happenig fastly

i want resolving to happen fastly for local ips, external fastly

how i can manage resolv.conf, /etc/nsswitch.conf /etc/hosts & route to acheive same?
Old 04-14-2014, 08:33 AM   #4
LQ Newbie
Registered: Nov 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
If any one has any answer pls let me know. i'm stuck here
Old 04-14-2014, 09:42 AM   #5
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,714

Rep: Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280
My /etc/nsswitch.conf handles that:

The entry
hosts:      files mdns4_minimal [NOTFOUND=return] dns myhostname
directs name resolution to files first (so any host in the /etc/hosts file will be used first) then the optional MS dns protocol, followed by the real DNS. The "myhostname" is a plugin to reach a NSS name cache... and is also optional. A suggested minimum is "files dns".

BTW: sometimes the "mdns4_minimal [NOTFOUND=return]" can be dropped as if there IS a windows domain controller it may not be responding - causing long timeouts before the system goes to using DNS directly.

Last edited by jpollard; 04-14-2014 at 09:47 AM.


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
can I use resolv.conf to have a local DNS entry tkmsr Linux - Server 7 01-10-2011 03:33 PM
/etc/resolv.conf resolving sub-domains noir911 Linux - Server 2 02-10-2008 11:29 PM
Resolv.conf updated every time DHCP leases? jon_k Linux - Software 2 08-01-2006 05:32 PM
DNS Hosts.conf or resolv.conf problem mac_casey SUSE / openSUSE 0 03-26-2006 10:21 AM
Why is Resolving taking so long? DevilDust Linux - Networking 11 08-09-2004 12:55 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration