DNS & Load balancing(dior8wsh)

Giorgos Keramidas keramida at ceid.upatras.gr
Thu Sep 21 00:12:58 EEST 2000


On Wed, Sep 20, 2000 at 09:38:04AM +0300, Yiannis An. Mandravellos wrote:
> 
> mallon "man gethostbyname"  ennoeis ;-)
> 
> Thes na peis oti, epeidh o DNS epistrefei kai tis dyo (h kai tis 100) IP, to
> ping kathe icmp packet poy stelnei tha to stelnei se allh dieythynsh? Den to
> exo dei na doyleyei etsi kai, pistepse me, to exo dokimasei to
> round-robin...

err, den nomizo to ping na kanei ksana lookup gia *kathe* paketo pou
thelei na steilei. mallon kanei tin proth fora, pairnei to prwto address
tou apotelesmatos (to opoio to exei hdh kanei round robin o DNS server),
kai stelnei panta ekei ta icmp packets tou.

gia na eimaste sigouroi pantws, koitame kai to source, kai to blepoume
sto freebsd gia paradeigma apo to /usr/src/sbin/ping/ping.c:

	hp = gethostbyname2(target, AF_INET);
	if (!hp)
		errx(EX_NOHOST, "cannot resolve %s: %s",
			target, hstrerror(h_errno));

	to->sin_len = sizeof *to;
	if (hp->h_length > sizeof(to->sin_addr))
		errx(1,"gethostbyname2 returned an illegal address");
	memcpy(&to->sin_addr, hp->h_addr_list[0], sizeof to->sin_addr);

apo kei kai pera, to struct `to' xrhsimopoieitai kai den kanei ksana
name lookup.

an kaneis *pali* lookup, tote tha pareis efoson o BIND uposthrizei
to load-balancing, me diaforetikh seira ta apotelesmata, kai afou o
parapano kwdikas xrhsimopoiei to h_addr_list[0], tha steileis se allo IP
ta icmp packets tou ping.

-- 
Giorgos Keramidas, <keramida at ceid.upatras.gr>
For my public pgp2 key: finger -l keramida at diogenis.ceid.upatras.gr

--
linux-greek-users mailing list -- http://lists.hellug.gr




More information about the Linux-greek-users mailing list