Fc - Force Compression

Fc - Force Compression

This modifier enables DNS compression in the response, overriding any DNS compression settings specified in the configuration file.

This modifier is compatible with and can be combined with any other existing feature or modifier.

Category: Packet manipulation

Format

*.fc.*

This module has no parameters.

Examples

In this example, we use the basic always feature which always resolves to an IP address. Additionally, we request to enable DNS compression for the response:

# dig always.fc.yourdomain.com @127.0.0.1

; <<>> DiG 9.18.10-2-Debian <<>> always.fc.yourdomain.com @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30074
;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;always.fc.yourdomain.com.	IN	A

;; ANSWER SECTION:
always.fc.yourdomain.com. 60	IN	A	2.3.4.5

;; Query time: 3 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Mon Oct 21 14:53:22 +04 2024
;; MSG SIZE  rcvd: 58

Download PCAP File

We can see that with compression enabled, the response is 58 bytes long.


Similar to the previous example, but in this case we request to disable DNS compression using the nc modifier:

# dig always.nc.yourdomain.com @127.0.0.1

; <<>> DiG 9.18.10-2-Debian <<>> always.nc.yourdomain.com @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62964
;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;always.nc.yourdomain.com.	IN	A

;; ANSWER SECTION:
always.nc.yourdomain.com. 60	IN	A	2.3.4.5

;; Query time: 4 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Mon Oct 21 15:52:48 +04 2024
;; MSG SIZE  rcvd: 82

Download PCAP File

We can see that with compression disabled, the response is 82 bytes long.


In this example, we use the size feature to fit as many A records as possible within a 300-byte size limit. Additionally, we request to enable DNS compression for the response:

# dig size.300.fc.yourdomain.com @127.0.0.1

; <<>> DiG 9.18.10-2-Debian <<>> size.300.fc.yourdomain.com @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17764
;; flags: qr aa; QUERY: 1, ANSWER: 16, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;size.300.fc.yourdomain.com.	IN	A

;; ANSWER SECTION:
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.177
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.236
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.246
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.91
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.176
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.40
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.76
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.211
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.34
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.236
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.108
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.232
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.112
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.72
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.134
size.300.fc.yourdomain.com. 60	IN	A	127.0.0.218

;; Query time: 3 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Mon Oct 21 14:53:23 +04 2024
;; MSG SIZE  rcvd: 300

Download PCAP File

With compression enabled, it’s possible to fit sixteen (16) A records within the 300-byte limit.


Similar to the previous example, but in this case we request to disable DNS compression for the response:

# dig size.300.nc.yourdomain.com @127.0.0.1

; <<>> DiG 9.18.10-2-Debian <<>> size.300.nc.yourdomain.com @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57478
;; flags: qr aa; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;size.300.nc.yourdomain.com.	IN	A

;; ANSWER SECTION:
size.300.nc.yourdomain.com. 60	IN	A	127.0.0.144
size.300.nc.yourdomain.com. 60	IN	A	127.0.0.129
size.300.nc.yourdomain.com. 60	IN	A	127.0.0.87
size.300.nc.yourdomain.com. 60	IN	A	127.0.0.111
size.300.nc.yourdomain.com. 60	IN	A	127.0.0.169
size.300.nc.yourdomain.com. 60	IN	A	127.0.0.45

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Mon Oct 21 15:52:49 +04 2024
;; MSG SIZE  rcvd: 296

Download PCAP File

With compression disabled, we can only fit six (6) A records within the same 300-byte limit.


From the same category

See also


Go back to catalogue.