LinuxQuestions.org
Review your favorite Linux distribution.
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 03-26-2014, 03:57 AM   #1
NagaManjunath
LQ Newbie
 
Registered: Nov 2011
Posts: 7

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


hi,
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 192.168.103.11 on which I will do corba communication & 192.168.107.41 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
nameserver 192.168.107.41

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

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

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

In the log you will 192.168.107.41 being used instead of corba ip 192.168.103.11. 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 192.168.103.11 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:
user$route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.107.41 0.0.0.0 UG 0 0 0 eth0.7
10.0.0.0 * 255.0.0.0 U 0 0 0 eth2
192.168.103.0 * 255.255.255.0 U 0 0 0 eth0.3
192.168.103.11 * 255.255.255.255 UH 0 0 0 eth0.3
192.168.104.0 * 255.255.255.0 U 0 0 0 eth0.4
192.168.105.0 * 255.255.255.0 U 0 0 0 eth0.5
192.168.106.0 * 255.255.255.0 U 0 0 0 eth0.6
192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.7
192.168.107.11 * 255.255.255.255 UH 0 0 0 eth0.7
192.168.107.41 * 255.255.255.255 UH 0 0 0 eth0.7
192.168.108.0 * 255.255.255.0 U 0 0 0 eth0.8
192.168.153.0 * 255.255.255.0 U 0 0 0 eth1
Attached Files
File Type: txt localhost4.txt (170.6 KB, 11 views)

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

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
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
NagaManjunath
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 192.168.107.41

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
NagaManjunath
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
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

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

The entry
Code:
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.
 
  


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
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


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