Solved

DNS problems

Posted on 2006-06-12
8
412 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
  • 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
 
LVL 9

Accepted Solution

by:
jabiii earned 500 total points
ID: 16888274
nslookup www.yahoo.com as already stated
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Let’s list some of the technologies that enable smooth teleworking. 
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now