Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-14-2015, 03:12 AM
|
#1
|
Member
Registered: Sep 2005
Posts: 861
Rep:
|
Identify which DNS server being used
I realized that when we try to telnet a domain which has multiple hosts on them (round robin), it always give me a specific IP. As opposed to using ping and nslookup. Does anyone know why is this case? Does it cache it somewhere?
|
|
|
01-14-2015, 03:40 AM
|
#2
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912
|
Actually, it returns the entire list - but the list itself is rotated.
telnet only uses the first entry.
As for ping, it doesn't do any different.
You can be using a cache only name server locally, which should provide whatever it has in its cache. If you are using bind then it will rotate as well, but it isn't mandatory that such a server has to, and I believe bind can be configured to turn off rotation (I haven't kept up with bind since I stopped being an admin)
As to which DNS server is being used, check the /etc/resolv.conf file at the time. If you are using DHCP, then the values shown may change... So check at the time you have a question.
One last thing - nslookup/dig/ whatever actually don't use the /etc/nsswitch.conf - they are designated to check DNS, so they don't use gethostbyname library function. They use the DNS library directly which is bypassing the nsswitch.conf file.
Last edited by jpollard; 01-14-2015 at 03:44 AM.
|
|
|
01-14-2015, 05:04 PM
|
#3
|
Member
Registered: Sep 2005
Posts: 861
Original Poster
Rep:
|
Thanks for the response. I was wondering if there is a way to get that list that is showing that the IP we see is the first. Since nslookup and dig even oung gives us different IP each time.
|
|
|
01-14-2015, 07:14 PM
|
#4
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,636
|
you really should be using ssh
telnet is INSECURE
all and every login credential is in plain text that EVERY one on the net could read
|
|
|
01-14-2015, 08:21 PM
|
#5
|
Member
Registered: Sep 2005
Posts: 861
Original Poster
Rep:
|
Thanks. I understand that. I am just using the tool for the purpose of checking what server the client hits when it tries to resolve a round-robin'd server. Apparently, its connecting only to one host from the multiple servers specified on that specific domain. Just want to pin-down how these tools get only that specific IP.
|
|
|
01-15-2015, 06:07 AM
|
#6
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912
|
The intent with the list of IP numbers is that if the application fails with the first one, it then tries the second, followed by the third...
But most programmers have been lazy and not tested anything but the first.
The network is inherently failure prone - which is why the simple load balancing by rotating the numbers is done. At a minimum, each separate connection (from different systems that is) will get a different IP number as the first try. If it works, fine - the load has been spread.
If it fails, then the application should try the next.
It is just old history that only the first is tried - and that goes back to before DNS existed. Network connections were expensive (up to $50,000 US in the very earliest days) so there was at most only one network interface. Host names were distributed as single files to be put in the /etc/host file. That only worked until the list passed around 5,000 to 10,000 hosts. And could not be kept up with (network connection costs dropped tremendously by then as well).
DNS was a way to permit access to a distributed database of hosts. At which time a single server host would tend to get overloaded with connections, and servers needed to spread the load among multiple interfaces... and multiple hosts. DNS provided that... then to help the balancing with those applications that only tried the first, rotation was added. (This is a VERY rough history).
The original killer applications were mail, ftp, and, telnet. Though mail and ftp were the heavy hitters, all three historically only try the first IP number in a list... and only supported use of UDP for the DNS messasges. TCP is now supported - especially for those "host" names supporting clusters. I have seen as many 120 IP numbers for a givin host (no, it didn't work correctly for many applications... the reverse lookup would fail due to the list of IP numbers being longer than what would fit within a UDP packet - which was limited to about 35 to 40 IP numbers).
One problem pointed out to me with telent - you can't easily modify it to try multiple IP numbers due to the protocol design used in creating a telent connection. This is not related to TCP protocol - this is an application protocol used to maintain interactivity with the user, and the remote host, and is a bit overcomplex - but one of the first, if not THE first, ever created.
|
|
|
All times are GMT -5. The time now is 01:34 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|