Solved

DNS problems

Posted on 2006-06-12
8
466 Views
Last Modified: 2013-12-06
Hello,

I am using Linux Fedora core 4.
This server is DNS client, i configure /etc/resolv.conf  as follow:
 
  search ...
  nameserver   203.162.4.1
  nameserver   203.162.0.11
...................................

when execute command "host www.mydomain.com" , i get the result:
    www.mydomain.com has address 203.162.148.163
    www.mydomain.com has address 203.162.148.164
............................................................
............................................................

Then I execute command "ping www.mydomain.com" , i get the result:
    64 bytes from www.saigonbank.com.vn (203.162.148.163): icmp_seq=4 ttl=255 time=0.434 ms
    64 bytes from www.saigonbank.com.vn (203.162.148.163): icmp_seq=4 ttl=255 time=0.434 ms
   ^C
After that, I execute command "ping www.mydomain.com" again, i get another result:
    64 bytes from www.saigonbank.com.vn (203.162.148.164): icmp_seq=4 ttl=255 time=0.434 ms
    64 bytes from www.saigonbank.com.vn (203.162.148.164): icmp_seq=4 ttl=255 time=0.434 ms
   ^C
................

I mean, the first ping command , i rearch   203.162.148.163 address, the second ping command, i rearch  203.162.148.164 address,  the third ping command, i reach 203.162.148.163  again and so on,...

Can any one tell me why 2 ip address is used in shifts?

Now i want to configure to reach only to 203.162.148.163  or 203.162.148.164 when i ping to www.mydomain.com. What should we do now?

Thanks
 
0
Comment
Question by:freshrain
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 3

Expert Comment

by:papimichel
ID: 16883850
it is for load balancing purposes.

try doing it for google.com and you'll recieve similar results.
0
 
LVL 3

Expert Comment

by:papimichel
ID: 16883854
on windows machines -

ping www.google.com 
then run
ipconfig /flushdns
and then try again
ping www.google.com

you'll see different ip addresses.
0
 
LVL 2

Expert Comment

by:munk33
ID: 16886069
papimichel explains the reasoning for your query. As many company's have multiple servers for the same services clients are redirected.

If you would prefer to connect to a specific ip when using dns lookups.... Add the hostname and the ip in the /etc/hosts file on the fedora box.
0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
LVL 9

Accepted Solution

by:
jabiii earned 500 total points
ID: 16888274
nslookup www.yahoo.com as already stated
0
 

Author Comment

by:freshrain
ID: 16892185
But when the user access www.mydomain.com, this domain is always resolved by ISP first ( doesn't relate to /etc/hosts file ).
0
 
LVL 2

Expert Comment

by:munk33
ID: 16892594
The name resolution order is hosts file then dns. If an entry were in /etc/hosts it would not lookup a dns server, therefore use the ip set in the hosts file and connect to the desired ip.

I have used this myself, mainly to stop quering a dns server (for privacy reasons)

However.... maybe this is not correct in ur case??

Hope u solve ur issue :)
0
 

Author Comment

by:freshrain
ID: 16899264
Hello munk33,

203.162.148.163 & 203.162.148.164 are 2 real IP address, and my webserver' IP address is 192.168.8.3 ( local address ) . So, if internet user ( out side my network ) access my page,  then www.mydomain.com is always resolved by DNS server ( located at my ISP provider ) first. So, the /etc/hosts file only effect when we access www.mydomain.com. from webserver ifself.

VuNguyen
0
 
LVL 2

Expert Comment

by:munk33
ID: 16902323
Ah now i understand :)

From reading your question it was not clear to me that you were running a webserver. Clearly i thought you were trying to access an external site, and were trying to make your machine connect to a specific ip.

This server is DNS client
Now i want to configure to reach only to 203.162.148.163  or 203.162.148.164 when i ping to www.mydomain.com. What should we do now?

Thx for putting me straight :):)

0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question