How it works: A few words about DNS. DNS server - what is it? DNS Unlocker - what is it? How to Determine If Your Computer is Infected with Malware

/STD 13

The basis of DNS is the idea of ​​a hierarchical structure of a domain name and zones. Each server responsible for the name can delegate responsibility for the further part of the domain to another server (from an administrative point of view - another organization or person), which allows you to assign responsibility for the relevance of information to the servers of various organizations (people) who are responsible only for “their” part of the domain name.

Since 2010, tools for checking the integrity of transmitted data, called DNS Security Extensions(DNSSEC). The transmitted data is not encrypted, but its accuracy is verified using cryptographic methods. The introduced DANE standard ensures the transmission of reliable cryptographic information(certificates) used to establish safe and secure connections at the transport and application layers.

Key DNS Features

DNS has the following characteristics:

  • Distributed administration. Responsibility for different parts of the hierarchical structure lies different people or organization.
  • Distributed information storage. Each network node in mandatory must store only the data that is included in its area of ​​responsibility, and (possibly) addresses root DNS servers.
  • Caching information. Knot Maybe store a certain amount of data outside of your area of ​​responsibility to reduce the load on the network.
  • Hierarchical structure, in which all nodes are combined into a tree, and each node can either independently determine the operation of lower nodes, or delegate(transmit) them to other nodes.
  • Reservation. Several servers, separated both physically and logically, are responsible for storing and maintaining their nodes (zones), which ensures data safety and continuation of work even if one of the nodes fails.

Addresses were assigned manually. To request a hostname and address and add a computer to main file, users contacted the network information center(NIC) SRI, led by Elizabeth Feinler, by telephone during business hours.

By the early 1980s, maintaining a single, centralized table of hosts had become slow and cumbersome, and developing network was required automatic system naming to resolve technical and personnel issues. Postel set himself the task of working out a compromise between five competing proposals to solve the problem formulated by Paul Mockapetris. Mockapetris created the concept instead hierarchical system domain names.

Methods such as can also be used to confirm DNS results reverse DNS with confirmation of direct records, but they are not cryptographically reliable; This does not take into account the option of substituting routing information. BGP hijacking).

Terminology and principles of operation

The key concepts of DNS are:

  • Domain(English domain “area”) - a node in a tree of names, together with all nodes subordinate to it (if any), that is, a named branch or under the tree in the tree of names. The structure of a domain name reflects the order of nodes in the hierarchy; the domain name is read from left to right from minor domains to domains top level(in order of increasing importance): at the top is the root domain (with the identifier “ .” (dot)), below are first-level domains (domain zones), then second-level domains, third, etc. (for example, for the address ru .wikipedia.org. The first level domain is org, the second is wikipedia, the third is ru). DNS allows you to not specify a root domain point.
  • Subdomain(English subdomain) - subordinate domain (for example, wikipedia.org - subdomain domain org, and ru.wikipedia.org - the domain wikipedia.org). Theoretically, this division can reach a depth of 127 levels, and each label can contain up to 63 characters, until the total length, including periods, reaches 254 characters. But in practice, domain name registrars use more stringent restrictions. For example, if you have a domain like mydomain.ru, you can create different subdomains for it like mysite1.mydomain.ru, mysite2.mydomain.ru, etc.
  • Resource record- a unit of storage and transmission of information in DNS. Each resource record It has Name(that is, tied to a certain domain name, node in the name tree), type And data field, the format and content of which depends on type.
  • Zone- part of the domain name tree (including resource records), hosted as a single unit on some domain name server ( DNS server, see below), and more often - simultaneously on several servers (see below). The purpose of separating a part of a tree into a separate zone is to transfer responsibility(see below) for the corresponding domain to another person or organization. It is called delegation(see below). Like a coherent part of a tree, zone The inside is also a tree. If we consider the DNS namespace as a structure of zones, rather than individual nodes/names, we also get a tree; it is justified to talk about parent and child zones, about senior and subordinate zones. In practice, most level 0 and level 1 zones (".", ru, com, ...) consist of a single node to which child zones are directly subordinate. In large corporate domains(2nd or more levels) sometimes the formation of additional subordinate levels without separating them into child zones.
  • Delegation- transfer operation responsibility for part of the domain name tree to another person or organization. Due to delegation in DNS, distributed administration and storage are ensured. Technically delegation is expressed in separating this part of the tree into a separate zone, and placement of this zones on DNS server(see below) operated by that person or organization. In this case, the “gluing” ones are included in the parent zone resource records(NS and A) containing pointers to DNS servers child zone, and all other information related to the child zone is stored on DNS servers child zone.
  • DNS server- specialized software for DNS maintenance, as well as the computer on which this software runs. The DNS server may be responsible for some zones and/or may forward requests to upstream servers.
  • DNS client- a specialized library (or program) for working with DNS. In some cases, the DNS server acts as a DNS client.
  • Authority(English authoritative) - a sign of the location of the zone on the DNS server. DNS server responses can be of two types: authoritative(when the server declares that it is responsible for the zone) and unauthoritative(eng. Non-authoritative) when the server processes the request and returns a response from other servers. In some cases, instead of passing the request on, the DNS server may return a value already known to it (from previous requests) (caching mode).
  • DNS query(eng. DNS query) - a request from a client (or server) to a server. The request may be recursive or non-recursive(see Recursion).

The DNS system contains a hierarchy DNS servers, corresponding to the hierarchy zones. Each zone supported by at least one authoritative DNS server(from the English authoritative - authoritative), on which information about the domain is located.

To increase the stability of the system, many servers containing identical information are used, and the protocol has tools to maintain the synchronism of information located on different servers. There are 13 root servers, their addresses practically do not change.

DNS protocol uses TCP or UDP port 53 to respond to requests. Traditionally, requests and responses are sent as a single UDP datagram. TCP is used when the response data size exceeds 512 bytes and for AXFR requests.

Recursion

The term recursion in DNS they denote a behavior algorithm DNS servers: execution on behalf of the client full search necessary information throughout the DNS system, reaching out to others as needed DNS servers.

DNS query May be recursive- requiring a full search, - and non-recursive(or iterative) - not requiring a full search.

Likewise - DNS server May be recursive(able to perform a full search) and non-recursive(those who do not know how to perform a full search). Some DNS server programs, such as BIND, can be configured to accept queries from certain clients recursively, and the requests of others - non-recursively.

When answering non-recursive request, as well as in case of inability or prohibition to fulfill recursive requests, the DNS server either returns data about the zone for which it responsible, or returns an error. The settings of a non-recursive server, when the response produces addresses of servers that have more information about the requested zone than the responding server (most often the addresses of root servers), are incorrect, and such a server can be used to organize DoS attacks.

When recursive request DNS server queries servers (in descending order of zone level in the name) until it finds an answer or discovers that the domain does not exist (in practice, the search begins with the DNS servers closest to the searched one, if information about them is in the cache and is not out of date, the server may not query other DNS servers).

Let's look at an example of how the entire system works.

Recursive requests require more resources from the server (and create more traffic), so they are usually accepted from nodes “known” to the server owner (for example, the provider provides the ability to make recursive requests only to its clients, in corporate network recursive requests are accepted only from the local segment). Non-recursive queries are usually accepted from all nodes on the network (and a meaningful response is given only to queries about the zone that is hosted on the node; a DNS query about other zones usually returns the addresses of other servers).

Reverse DNS lookup

DNS is used primarily to resolve symbolic names to IP addresses, but it can also perform the reverse process. For this purpose, existing DNS tools are used. The point is that with DNS record various data can be compared, including any symbolic name. There is a special domain in-addr.arpa, whose entries are used to resolve IP addresses into symbolic names. For example, to obtain the DNS name for the address 11.22.33.44, you can query the DNS server for the record 44.33.22.11.in-addr.arpa, and it will return the corresponding symbolic name. Reverse order recording parts of an IP address is explained by the fact that in IP addresses the high-order bits are located at the beginning, and in symbolic DNS names the high-order (closer to the root) parts are located at the end.

Links

(Digital Network System - English Digital network system) - Russian company, owner of a retail chain specializing in the sale of computer, digital and household appliances, as well as a manufacturer of computers, including laptops, tablets and smartphones (assembly production). As of mid-2015, the network has more than 1,200 stores in 400 cities in Russia. The company's headquarters is located in Vladivostok.

The general director and co-owner of the company is Dmitry Alekseev.

Story

The founders of the company in the 1990s were engaged in the computer business: assembling and selling PCs, system integration. In 1998, after the default, they decided to refocus from servicing corporate clients on retail trade. The DNS (Digital Network System) company was founded and the first store was opened in Vladivostok, in one of the premises of which computers were assembled.

Since 2005, the company begins to develop trading network, opening its second store in Nakhodka. In the same year, DNS expanded beyond the Primorsky Territory, and the third store of the chain appeared in Khabarovsk. In 2006, a store opened in Irkutsk, in 2007 - stores in Komsomolsk-on-Amur, Blagoveshchensk, Tomsk and Abakan. During 2008-2009, stores were opened in Chita, Novosibirsk, Krasnoyarsk, Yekaterinburg, Chelyabinsk, Rostov-on-Don, Yuzhno-Sakhalinsk. Simultaneously with development in new regions, it is already expanding existing network in regions of presence.

In 2010, the company's branch network consisted of more than 100 stores in 28 cities of Russia, employing more than 1.5 thousand employees. At the beginning of 2011, more than 185 stores were opened in 60 cities of Russia, the number of employees was more than 3.5 thousand. By this time the company had begun expansion into metropolitan region(Moscow, Moscow region), continuing to develop in Siberia and the south of the country. As of July 2013, more than 700 stores were opened in more than 200 cities of Russia.

In 2012, a plant built by DNS began operating in the city of Artyom, Primorsky Territory, designed to assemble 1.5 million computers and laptops per year. At the end of the same 2012, the company’s revenue amounted to 86.4 billion rubles, which allowed it to take 60th place in the ranking of the 200 largest private companies in Russia in 2013 by Forbes magazine.

In parallel with the DNS store chain, its owners began to develop a network of electronic discounters TechnoPoint, including warehouse stores, where orders are made via the Internet or electronic terminals. The network's branches operate in 20 cities of Russia, mainly in the Far East and Siberia.

Activity

In the first half of 2011, the company assembled 193 thousand computers, taking first place among Russian PC assemblers

The company also produces laptops, computers, monitors, smartphones, power supplies and computer accessories under own brands DNS, DEXP and Airtone.

30% of the company's revenue comes from computer accessories, 18% from laptops, 16% from smartphones, 13% from tablets, 11% from TVs, 3% each desktop computers And DSLR cameras, 2% - Cell phones, compact cameras and monitors.

Company

The company was founded by 10 residents of Vladivostok, who had known each other for a long time and had previous experience in the computer business, 9 of them work in the company as of 2015, the tenth died and his share in the company was inherited by his family. Among the founders is Dmitry Alekseev ( CEO), Konstantin Bogdanenko (business development director), Yuri Karptsov (financial director), Sergei Meshchanyuk (commercial director), Yuri Chernyavsky, Andrey Usov, Alexander Fedorov, Alexey Popov.

The company consists of more than 50 legal entities, registered in different regions, related by common owners, among them "DNS Baikal" (owner - Karptsov), "DNS NN" (owner - Meshchanyuk), "DNS Alfa Novosibirsk" (owner - Chernyavsky), "DNS Plus-Samara" (owner - Usov), "DNS-Perm" (owner - Fedorov), "DNS-Ekaterinburg" (owner - Bogdanenko), "DNS" in Khabarovsk (owner - Popov), "Vostok Center" (owner - Alekseev), "DNS-Kursk" ( owner Kichiy I.V.).

In 2013, the network united 700 computer and digital technology in 240 cities of Russia. Mainly outlets with an area of ​​300-500 m², there are also 25 hypermarkets up to 1000 m². In addition to stores, the company has 10 distribution centers with a total area of ​​30,000 m², a computer and laptop plant in Artyom, as well as assembly plants in the Moscow region (in Staraya Kupavna) and Novosibirsk.

In April 2014, the company acquired the network " Computer World"(21 stores in St. Petersburg and 11 more in other cities of the North-West). In April 2015, all store formats (Frau-Technika, TechnoPoint, Smart) were united under one single brand “DNS”.

Call or directly on the website! Our specialists will be happy to help you!

As a provider virtual infrastructure, 1cloud company is interested network technologies, which we regularly talk about on our blog. Today we have prepared material on the topic of domain names. In it we will look at the basic aspects of the functioning of DNS and security issues of DNS servers.

It’s also worth saying a few words about the reverse matching procedure - getting a name from the provided IP address. This happens, for example, during server checks Email. There is a special domain in-addr.arpa, entries in which are used to convert IP addresses into symbolic names. For example, to obtain the DNS name for the address 11.22.33.44, you can query the DNS server for the record 44.33.22.11.in-addr.arpa, and it will return the corresponding symbolic name.

Who manages and maintains DNS servers?

When you enter the address of an Internet resource into the browser line, it sends a request to the DNS server responsible for the root zone. There are 13 such servers and they are managed various operators and organizations. For example, a.root-servers.net has an IP address of 198.41.0.4 and is operated by Verisign, while e.root-servers.net (192.203.230.10) is operated by NASA.

Each of these operators provides this service free of charge, and also ensures uninterrupted operation, since if any of these servers fails, entire areas of the Internet will become unavailable. Previously, root DNS servers, which are the basis for processing all requests for domain names on the Internet, located in North America. However, with the introduction of alternative addressing technology, they "spread" throughout the world, and in fact their number increased from 13 to 123, which made it possible to increase the reliability of the DNS foundation.

Another option is to use the IP Source Guard feature. It relies on uRPF technology and DHCP packet snooping to filter out spoofed traffic on individual switch ports. IP Source Guard inspects DHCP traffic on the network and determines which IP addresses have been assigned to network devices.

Once this information has been collected and stored in the DHCP snooping aggregation table, IP Source Guard can use it to filter IP packets received network device. If a packet is received with a source IP address that does not match the DHCP packet snooping federation table, then the packet is discarded.

It is also worth noting the dns-validator utility, which monitors the transmission of all DNS packets, matches each request with a response, and if the headers do not match, notifies the user about it. detailed information available in

(assembly production). As of mid-2015, the network has more than 1,400 stores in 540 cities in Russia. The company's headquarters are located in Vladivostok.

DNS
Type Private company
Base
Location Russia Russia: Vladivostok
Key figures Dmitry Yuryevich Alekseev (General Director)
Industry retail trade ( ISIC: 47)
Turnover
Number of employees 15,000 people, central office - 500 people.
Website dns-shop.ru

Provides DNS transmission of reliable cryptographic information (certificates) used to establish safe and secure connections at the transport and application levels.

Key DNS Features

DNS has the following characteristics:

  • Distributed administration. Different people or organizations are responsible for different parts of the hierarchical structure.
  • Distributed information storage. Each network node must necessarily store only the data that is included in its area of ​​responsibility, and (possibly) addresses root DNS servers.
  • Caching information. Knot Maybe store a certain amount of data outside of your area of ​​responsibility to reduce the load on the network.
  • Hierarchical structure, in which all nodes are combined into a tree, and each node can either independently determine the operation of lower nodes, or delegate(transmit) them to other nodes.
  • Reservation. Several servers, separated both physically and logically, are responsible for storing and maintaining their nodes (zones), which ensures data safety and continuation of work even if one of the nodes fails.

To increase the stability of the system, many servers containing identical information are used, and the protocol has tools to maintain the synchronism of information located on different servers. There are 13 root servers, their addresses practically do not change.

The DNS protocol uses TCP or UDP port 53 to respond to requests. Traditionally, requests and responses are sent as a single UDP datagram. TCP is used when the response data size exceeds 512 bytes and for AXFR requests.

Recursion

The term Recursion in DNS they denote a behavior algorithm DNS servers, in which the server performs a complete search of the required information in the entire DNS system on behalf of the client, contacting others if necessary DNS servers.

DNS query May be recursive- requiring a full search, - and non-recursive(or iterative) - not requiring a full search.

Likewise - DNS server May be recursive(able to perform a full search) and non-recursive(those who do not know how to perform a full search). Some DNS server programs, such as BIND, can be configured to accept queries from certain clients recursively, and the requests of others - non-recursively.

When answering non-recursive request, as well as in case of inability or prohibition to fulfill recursive requests, the DNS server either returns data about the zone for which it responsible, or returns an error. The settings of a non-recursive server, when the response produces addresses of servers that have more information about the requested zone than the responding server (most often the addresses of root servers), are incorrect, and such a server can be used to organize DoS attacks.

When recursive request DNS server queries servers (in descending order of zone level in the name) until it finds an answer or discovers that the domain does not exist (in practice, the search begins with the DNS servers closest to the searched one, if information about them is in the cache and is not out of date, the server may not query other DNS servers).

Let's look at an example of how the entire system works.

Recursive requests require more resources from the server (and create more traffic), so they are usually accepted from nodes “known” to the server owner (for example, a provider provides the ability to make recursive requests only to its clients; in a corporate network, recursive requests are accepted only from the local segment). Non-recursive queries are usually accepted from all nodes on the network (and a meaningful response is given only to queries about the zone that is hosted on the node; a DNS query about other zones usually returns the addresses of other servers).

Reverse DNS lookup

DNS is used primarily to resolve symbolic names to IP addresses, but it can also perform the reverse process. For this purpose, existing DNS tools are used. The fact is that various data can be associated with a DNS record, including a symbolic name. There is a special domain in-addr.arpa, whose entries are used to resolve IP addresses into symbolic names. For example, to obtain the DNS name for the address 11.22.33.44, you can query the DNS server for the record 44.33.22.11.in-addr.arpa, and it will return the corresponding symbolic name. The reverse order of writing parts of an IP address is explained by the fact that in IP addresses the most significant bits are located at the beginning, and in symbolic DNS names the most significant (closer to the root) parts are located at the end.

DNS records

DNS records, or Resource records (English Resource Records, RR) - units of storage and transmission of information in DNS. Each resource record consists of the following fields:

The most important types of DNS records are:

Reserved domain names

Document RFC 2606 (Reserved Top Level DNS Names - Reserved names domains top level) defines domain names that should be used as examples (for example, in documentation) and also for testing. In addition to example.com, example.org and example.net, this group also includes test, invalid, etc.

International domain names

A domain name can only consist of limited set ASCII characters, allowing you to dial a domain address regardless of the user's language. ICANN has approved a Punycode-based IDNA system that converts any Unicode string into a valid DNS character set.

DNS Software

Name servers:

  • BIND (Berkeley Internet Name Domain)
  • djbdns (Daniel J. Bernstein's DNS)
  • MaraDNS
  • NSD (Name Server Daemon)
  • PowerDNS
  • OpenDNS
  • Microsoft DNS Server (in server versions operating systems Windows NT)
  • MyDNS

see also

  • Round robin DNS - load distribution between identical servers.

Write a review about the article "DNS"

Notes

Links

  • (English)
  • (English)
  • (English)
  • (English)
  • (English)
  • (English)
  • (English)

Articles

RFCs

  • RFC 1034 - Domain Name s - Concepts and Facilities
  • RFC 1035 - Domain Names - Implementation and Specification
  • RFC 1912 - Common DNS Operational and Configuration Errors
  • RFC 1591 - Domain Name System Structure and Delegation
  • RFC 1713 - Tools for DNS Debugging
  • RFC 2606 - Reserved Top Level DNS Names

Excerpt describing DNS

Likhachev stood up, rummaged through his packs, and Petya soon heard the warlike sound of steel on a block. He climbed onto the truck and sat on the edge of it. The Cossack was sharpening his saber under the truck.
- Well, are the fellows sleeping? - said Petya.
- Some are sleeping, and some are like this.
- Well, what about the boy?
- Is it spring? He collapsed there in the entryway. He sleeps with fear. I was really glad.
For a long time after this, Petya was silent, listening to the sounds. Footsteps were heard in the darkness and a black figure appeared.
- What are you sharpening? – the man asked, approaching the truck.
- But sharpen the master’s saber.
“Good job,” said the man who seemed to Petya to be a hussar. - Do you still have a cup?
- And over there by the wheel.
The hussar took the cup.
“It’ll probably be light soon,” he said, yawning, and walked off somewhere.
Petya should have known that he was in the forest, in Denisov’s party, a mile from the road, that he was sitting on a wagon captured from the French, around which horses were tied, that the Cossack Likhachev was sitting under him and sharpening his saber, what a big black spot to the right is a guardhouse, and a bright red spot below to the left is a dying fire, that the man who came for a cup is a hussar who was thirsty; but he knew nothing and did not want to know it. He was in a magical kingdom in which there was nothing like reality. A large black spot, perhaps there was definitely a guardhouse, or perhaps there was a cave that led into the very depths of the earth. The red spot might have been fire, or maybe the eye of a huge monster. Maybe he’s definitely sitting on a wagon now, but it’s very possible that he’s not sitting on a wagon, but on a terribly high tower, from which if he fell, he’d fly to the ground for a whole day, a whole month - keep flying and never reach it . It may be that just a Cossack Likhachev is sitting under the truck, but it may very well be that this is the kindest, bravest, most wonderful, most excellent person in the world, whom no one knows. Maybe it was just a hussar passing for water and going into the ravine, or maybe he just disappeared from sight and completely disappeared, and he was not there.
Whatever Petya saw now, nothing would surprise him. He was in a magical kingdom where everything was possible.
He looked at the sky. And the sky was as magical as the earth. The sky was clearing, and clouds were moving quickly over the tops of the trees, as if revealing the stars. Sometimes it seemed that the sky was clearing and black was showing, clear sky. Sometimes it seemed that these black spots were clouds. Sometimes it seemed as if the sky was rising high, high above your head; sometimes the sky dropped completely, so that you could reach it with your hand.
Petya began to close his eyes and sway.
Drops fell. There was a quiet conversation. The horses neighed and fought. Someone was snoring.
“Ozhig, zhig, zhig, zhig...” the saber being sharpened whistled. And suddenly Petya heard a harmonious choir of music playing some unknown, solemnly sweet hymn. Petya was musical, just like Natasha, and more than Nikolai, but he had never studied music, did not think about music, and therefore the motives that unexpectedly came to his mind were especially new and attractive to him. The music played louder and louder. The melody grew, moving from one instrument to another. What was called a fugue was happening, although Petya had not the slightest idea what a fugue was. Each instrument, sometimes similar to a violin, sometimes like trumpets - but better and cleaner than violins and trumpets - each instrument played its own and, not yet finishing the tune, merged with another, which started almost the same, and with the third, and with the fourth , and they all merged into one and scattered again, and again merged, now into the solemn church, now into the brightly brilliant and victorious.
“Oh, yes, it’s me in a dream,” Petya said to himself, swaying forward. - It's in my ears. Or maybe it's my music. Well, again. Go ahead my music! Well!.."
He closed his eyes. And with different sides, as if from afar, sounds began to tremble, began to harmonize, scatter, merge, and again everything united into the same sweet and solemn hymn. “Oh, what a delight this is! As much as I want and how I want,” Petya said to himself. He tried to lead this huge choir of instruments.
“Well, hush, hush, freeze now. – And the sounds obeyed him. - Well, now it’s fuller, more fun. More, even more joyful. – And from an unknown depth arose intensifying, solemn sounds. “Well, voices, pester!” - Petya ordered. And first, male voices were heard from afar, then female voices. The voices grew, grew in uniform, solemn effort. Petya was scared and joyful to listen to their extraordinary beauty.
The song merged with the solemn victory march, and drops fell, and burn, burn, burn... the saber whistled, and again the horses fought and neighed, not breaking the choir, but entering into it.
Petya didn’t know how long this lasted: he enjoyed himself, was constantly surprised by his pleasure and regretted that there was no one to tell it to. He was awakened by Likhachev's gentle voice.
- Ready, your honor, you will split the guard in two.
Petya woke up.
- It’s already dawn, really, it’s dawning! - he screamed.
The previously invisible horses became visible up to their tails, and a watery light was visible through the bare branches. Petya shook himself, jumped up, took a ruble from his pocket and gave it to Likhachev, waved, tried the saber and put it in the sheath. The Cossacks untied the horses and tightened the girths.
“Here is the commander,” said Likhachev. Denisov came out of the guardhouse and, calling out to Petya, ordered them to get ready.

Quickly in the semi-darkness they dismantled the horses, tightened the girths and sorted out the teams. Denisov stood at the guardhouse, giving the last orders. The party's infantry, slapping a hundred feet, marched forward along the road and quickly disappeared between the trees in the predawn fog. Esaul ordered something to the Cossacks. Petya held his horse on the reins, impatiently awaiting the order to mount. Washed cold water, his face, especially his eyes, burned with fire, a chill ran down his back, and something in his whole body was trembling quickly and evenly.
- Well, is everything ready for you? - Denisov said. - Give us the horses.
The horses were brought in. Denisov became angry with the Cossack because the girths were weak, and, scolding him, sat down. Petya took hold of the stirrup. The horse, out of habit, wanted to bite his leg, but Petya, not feeling his weight, quickly jumped into the saddle and, looking back at the hussars who were moving behind in the darkness, rode up to Denisov.
- Vasily Fedorovich, will you entrust me with something? Please... for God's sake... - he said. Denisov seemed to have forgotten about Petya’s existence. He looked back at him.
“I ask you about one thing,” he said sternly, “to obey me and not to interfere anywhere.”
During the entire journey, Denisov did not speak a word to Petya and rode in silence. When we arrived at the edge of the forest, the field was noticeably getting lighter. Denisov spoke in a whisper with the esaul, and the Cossacks began to drive past Petya and Denisov. When they had all passed, Denisov started his horse and rode downhill. Sitting on their hindquarters and sliding, the horses descended with their riders into the ravine. Petya rode next to Denisov. The trembling throughout his body intensified. It became lighter and lighter, only the fog hid distant objects. Moving down and looking back, Denisov nodded his head to the Cossack standing next to him.
- Signal! - he said.
The Cossack raised his hand and a shot rang out. And at the same instant, the tramp of galloping horses was heard in front, screams from different sides and more shots.
At the same instant as the first sounds of stomping and screaming were heard, Petya, hitting his horse and releasing the reins, not listening to Denisov, who was shouting at him, galloped forward. It seemed to Petya that it suddenly dawned as brightly as the middle of the day at that moment when the shot was heard. He galloped towards the bridge. Cossacks galloped along the road ahead. On the bridge he encountered a lagging Cossack and rode on. Some people ahead - they must have been French - were running with right side roads to the left. One fell into the mud under the feet of Petya's horse.
Cossacks crowded around one hut, doing something. A terrible scream was heard from the middle of the crowd. Petya galloped up to this crowd, and the first thing he saw was the pale face of a Frenchman with a shaking lower jaw, holding onto the shaft of a lance pointed at him.
“Hurray!.. Guys... ours...” Petya shouted and, giving the reins to the overheated horse, galloped forward down the street.
Shots were heard ahead. Cossacks, hussars and ragged Russian prisoners, running from both sides of the road, were all shouting something loudly and awkwardly. A handsome Frenchman, without a hat, with a red, frowning face, in a blue overcoat, fought off the hussars with a bayonet. When Petya galloped up, the Frenchman had already fallen. I was late again, Petya flashed in his head, and he galloped to where frequent shots were heard. Shots rang out in the courtyard of the manor house where he was with Dolokhov last night. The French sat down there behind a fence in a dense garden overgrown with bushes and fired at the Cossacks crowded at the gate. Approaching the gate, Petya, in the powder smoke, saw Dolokhov with a pale, greenish face, shouting something to the people. “Take a detour! Wait for the infantry!” - he shouted, while Petya drove up to him.
“Wait?.. Hurray!..” Petya shouted and, without hesitating a single minute, galloped to the place from where the shots were heard and where the powder smoke was thicker. A volley was heard, empty bullets squealed and hit something. The Cossacks and Dolokhov galloped after Petya through the gates of the house. The French, in the swaying thick smoke, some threw down their weapons and ran out of the bushes to meet the Cossacks, others ran downhill to the pond. Petya galloped on his horse along the manor's yard and, instead of holding the reins, strangely and quickly waved both arms and fell further and further out of the saddle to one side. The horse, running into the fire smoldering in the morning light, rested, and Petya fell heavily onto the wet ground. The Cossacks saw how quickly his arms and legs twitched, despite the fact that his head did not move. The bullet pierced his head.
After talking with the senior French officer, who came out to him from behind the house with a scarf on his sword and announced that they were surrendering, Dolokhov got off his horse and approached Petya, who was lying motionless, with his arms outstretched.
“Ready,” he said, frowning, and went through the gate to meet Denisov, who was coming towards him.
- Killed?! - Denisov cried out, seeing from afar the familiar, undoubtedly lifeless position in which Petya’s body lay.
“Ready,” Dolokhov repeated, as if pronouncing this word gave him pleasure, and quickly went to the prisoners, who were surrounded by dismounted Cossacks. - We won’t take it! – he shouted to Denisov.
Denisov did not answer; he rode up to Petya, got off his horse and with trembling hands turned Petya’s already pale face, stained with blood and dirt, towards him.
“I’m used to something sweet. Excellent raisins, take them all,” he remembered. And the Cossacks looked back in surprise at the sounds similar to the barking of a dog, with which Denisov quickly turned away, walked up to the fence and grabbed it.
Among the Russian prisoners recaptured by Denisov and Dolokhov was Pierre Bezukhov.

There was no new order from the French authorities about the party of prisoners in which Pierre was, during his entire movement from Moscow. This party on October 22 was no longer with the same troops and convoys with which it left Moscow. Half of the convoy with breadcrumbs, which followed them during the first marches, was repulsed by the Cossacks, the other half went ahead; there were no more foot cavalrymen who walked in front; they all disappeared. The artillery, which had been visible ahead during the first marches, was now replaced by a huge convoy of Marshal Junot, escorted by the Westphalians. Behind the prisoners was a convoy of cavalry equipment.
From Vyazma, the French troops, previously marching in three columns, now marched in one heap. Those signs of disorder that Pierre noticed at the first stop from Moscow have now reached the last degree.
The road along which they walked was littered with dead horses on both sides; ragged people lagging behind different teams, constantly changing, then joined, then again lagged behind the marching column.
Several times during the campaign there were false alarms, and the soldiers of the convoy raised their guns, shot and ran headlong, crushing each other, but then they gathered again and scolded each other for their vain fear.
These three gatherings, marching together - the cavalry depot, the prisoner depot and Junot's train - still formed something separate and integral, although both of them, and the third, were quickly melting away.
The depot, which had initially contained one hundred and twenty carts, now had no more than sixty left; the rest were repulsed or abandoned. Several carts from Junot's convoy were also abandoned and recaptured. Three carts were plundered by the backward soldiers from Davout's corps who came running. From conversations of the Germans, Pierre heard that this convoy was put on guard more than the prisoners, and that one of their comrades, a German soldier, was shot on the orders of the marshal himself because a silver spoon that belonged to the marshal was found on the soldier.
Of these three gatherings, the prisoner depot melted the most. Of the three hundred and thirty people who left Moscow, now less than a hundred remained. The prisoners were even more of a burden to the escorting soldiers than the saddles of the cavalry depot and Junot's baggage train. Junot’s saddles and spoons, they understood that they could be useful for something, but why did the hungry and cold soldiers of the convoy stand guard and guard the same cold and hungry Russians who were dying and lagged behind on the road, whom they were ordered to shoot? It’s not only incomprehensible, but also disgusting. And the guards, as if afraid in the sad situation in which they themselves were, not to give in to their feeling of pity for the prisoners and thereby worsen their situation, treated them especially gloomily and strictly.
In Dorogobuzh, while the convoy soldiers, having locked the prisoners in a stable, went off to rob their own stores, several captured soldiers dug under the wall and ran away, but were captured by the French and shot.
The previous order, introduced upon leaving Moscow, for captured officers to march separately from the soldiers, had long been destroyed; all those who could walk walked together, and Pierre, from the third transition, had already united again with Karataev and the lilac bow-legged dog, which had chosen Karataev as its owner.
Karataev, on the third day of leaving Moscow, developed the same fever from which he was lying in the Moscow hospital, and as Karataev weakened, Pierre moved away from him. Pierre didn’t know why, but since Karataev began to weaken, Pierre had to make an effort on himself to approach him. And approaching him and listening to those quiet moans with which Karataev usually lay down at rest, and feeling the now intensified smell that Karataev emitted from himself, Pierre moved away from him and did not think about him.
In captivity, in a booth, Pierre learned not with his mind, but with his whole being, life, that man was created for happiness, that happiness is in himself, in the satisfaction of natural human needs, and that all unhappiness comes not from lack, but from excess; but now, in these last three weeks of the campaign, he learned another new, comforting truth - he learned that there is nothing terrible in the world. He learned that just as there is no situation in which a person would be happy and completely free, there is also no situation in which he would be unhappy and not free. He learned that there is a limit to suffering and a limit to freedom, and that this limit is very close; that the man who suffered because one leaf was wrapped in his pink bed suffered in the same way as he suffered now, falling asleep on the bare, damp earth, cooling one side and warming the other; that when he used to put on his narrow ballroom shoes, he suffered in exactly the same way as now, when he walked completely barefoot (his shoes had long since become disheveled), with feet covered with sores. He learned that when, as it seemed to him, he had married his wife of his own free will, he was no more free than now, when he was locked in the stable at night. Of all the things that he later called suffering, but which he hardly felt then, the main thing was his bare, worn, scabby feet. (Horse meat was tasty and nutritious, the saltpeter bouquet of gunpowder, used instead of salt, was even pleasant, there was not much cold, and during the day it was always hot while walking, and at night there were fires; the lice that ate the body warmed pleasantly.) One thing was hard. at first it’s the legs.
On the second day of the march, after examining his sores by the fire, Pierre thought it impossible to step on them; but when everyone got up, he walked with a limp, and then, when he warmed up, he walked without pain, although in the evening it was even worse to look at his legs. But he did not look at them and thought about something else.
Now only Pierre understood the full power of human vitality and the saving power of moving attention invested in a person, similar to that saving valve in steam engines that releases excess steam as soon as its density exceeds a known norm.
He did not see or hear how the backward prisoners were shot, although more than a hundred of them had already died in this way. He did not think about Karataev, who was weakening every day and, obviously, was soon to suffer the same fate. Pierre thought even less about himself. The more difficult his situation became, the more terrible the future was, the more, regardless of the situation in which he was, joyful and soothing thoughts, memories and ideas came to him.

On the 22nd, at noon, Pierre was walking uphill along a dirty, slippery road, looking at his feet and at the unevenness of the path. From time to time he glanced at the familiar crowd surrounding him, and again at his feet. Both were equally his own and familiar to him. The lilac, bow-legged Gray ran merrily along the side of the road, occasionally, as proof of his agility and contentment, tucking his hind paw and jumping on three and then again on all four, rushing and barking at the crows that were sitting on the carrion. Gray was more fun and smoother than in Moscow. On all sides lay the meat of various animals - from human to horse, in varying degrees of decomposition; and the wolves were kept away by the walking people, so Gray could eat as much as he wanted.
It had been raining since the morning, and it seemed that it would pass and clear the sky, but after a short stop the rain began to fall even more heavily. The rain-saturated road no longer absorbed water, and streams flowed along the ruts.