LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-23-2004, 03:07 AM   #1
har5ha
Member
 
Registered: Mar 2004
Location: NY
Distribution: Red Hat 9 [Kernel 2.6.6-1.435]
Posts: 72

Rep: Reputation: 15
Question Dns Question .....


Hi All,

I am connected to the Internet through a winxp machine [internet connection sharing DHCP].

Every time I try to access any website the Dns request goes to the winxp box [as it should as it has the name server]


My Question is

Is there any way i could make the dns resolver look on the local system before it tries to access external dns server???

I mean by editing a file and providing static host name to ip mappings like

xxx.xxx.xxx.xxx yahoo.com


i edited resolv.conf and hosts.conf and provided mappings as above.. but it doesnt seem to be workin...

i found this out by running ethereal... the dns requests are still goin to the external dns server [winxp box].


Am i missing something??????


Please enlighten me......


BYe!!!!!
 
Old 07-23-2004, 07:40 AM   #2
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
You can setup the mappings you want in the /etc/hosts file... note this is NOT the /etc/hosts.conf file. However, you're wanting to put sites like yahoo.com??? Seems a bit too much trouble for that. Maybe if we knew what you're trying to accomplish it would be easier to suggest something more meaningful. From the sound of things you just want to make things more efficient by not having to connect to another machine to lookup domains???
 
Old 07-23-2004, 11:41 PM   #3
har5ha
Member
 
Registered: Mar 2004
Location: NY
Distribution: Red Hat 9 [Kernel 2.6.6-1.435]
Posts: 72

Original Poster
Rep: Reputation: 15
Thanks for ur input...

I put some [ip - name ] mappings into /etc/hosts file ..

It seems to work!!!!!!

NO DNS LOOKUPS R happening for those......

Bye!!!
 
Old 07-24-2004, 05:15 AM   #4
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
harsha

You cannot put the IPs of all the websites in the world in your /etc/hosts. Edit your resolv.conf and put the IP of an external dns server ... preferably the one that your XP system uses.

edit /etc/resolv.conf and put

nameserver < ip of external DNS>

If you are getting your IP from the XP system, edit your /etc/sysconfig/network-scripts/ifcfg-eth0

and set PEERDNS=no.

This will stop resetting your resolv.conf.

Last edited by ppuru; 07-24-2004 at 05:17 AM.
 
Old 07-24-2004, 11:12 AM   #5
har5ha
Member
 
Registered: Mar 2004
Location: NY
Distribution: Red Hat 9 [Kernel 2.6.6-1.435]
Posts: 72

Original Poster
Rep: Reputation: 15
hi ppuru

thanks for ur input..

but i have a question

when u said --> You cannot put the IPs of all the websites in the world in your /etc/hosts.

r u telling me its not [ feasible/possible ] to add [ip to name sever mapping] into my /etc/hosts file..

But i have written a script which parses my mozilla firefox [history.dat] for URL's and does a name server lookup and write's the mappings into a file --> which i can paste into my /etc/hosts file..

I have done this as i deem it unnecessary for my system to do a dns lookup for these limited number of website's that i browse daily.



Bye!!!
 
Old 07-24-2004, 11:20 AM   #6
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
It is extremely tedious and a waste of your time. ... you can run a cacheing dns server on your system and points it forwarders to your XP machine...

I was under the (wrong) impression that you are unable to access any dns server and are trying to do the host-ip mapping using your /etc/hosts. My apologies.
 
Old 07-24-2004, 01:42 PM   #7
iantri
Member
 
Registered: Jul 2003
Posts: 38

Rep: Reputation: 15
I agree with ppuru. What, exactly, is the point of adding numerous addresses to your hosts file when the time it takes to contact your ISP's DNS server and get a response is <100ms?

The other problem, and the fact that you bring up yahoo is a good one, is that many sites use round-robin DNS to balance load, which means that there is no guarantee that the server on the IP address you have set will provide the best service. Also, if a site changes their IP address, it will suddenly stop working.

There is absolutely no benefit to doing this.

If you are insistant on doing this, look up "caching dns" on freshmeat.net and you will find a simple caching DNS server that will store ip addresses for a limited period of time to speed up DNS requests (the time they take is insignifigant anyway, unless you are on satellite internet).
 
Old 07-24-2004, 03:34 PM   #8
har5ha
Member
 
Registered: Mar 2004
Location: NY
Distribution: Red Hat 9 [Kernel 2.6.6-1.435]
Posts: 72

Original Poster
Rep: Reputation: 15
Thanks Once again..

Appreciate all ur thoughts regarding DNS.. .

Will definitely look up the [dns caching] thing....
 
  


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
dns question jelgavchik Linux - Networking 1 01-29-2005 02:51 AM
DNS Question hansi umayangan Linux - General 3 09-02-2004 08:33 AM
DNS question J_Szucs Linux - Software 4 10-31-2003 03:02 AM
dns question -- new to dns gadhiraju Linux - Networking 7 05-09-2001 05:59 PM
dns question -- new to dns gadhiraju Linux - General 2 05-09-2001 07:44 AM

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

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