# Option 66 - Null Character Provided by dnsmasq

**URL:** <https://discourse.pi-hole.net/t/option-66-null-character-provided-by-dnsmasq/33015>\
**Category:** Help\
**Created:** [May 21, 2020, 4:44am UTC](https://discourse.pi-hole.net/t/option-66-null-character-provided-by-dnsmasq/33015 "2020-05-21T04:44:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lux4rd0](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/lux4rd0/32/15446_2.png) [@Lux4rd0](https://discourse.pi-hole.net/u/Lux4rd0)\
**Post date:** [May 21, 2020, 4:44am UTC](https://discourse.pi-hole.net/t/option-66-null-character-provided-by-dnsmasq/33015/1 "2020-05-21T04:44:38Z")

</div>

Running Pi-hole Version v5.0 Web Interface Version v5.0 FTL Version v5.0 on CentOS 7.

## Expected Behaviour:

Expecting options for:

`Bootfile Name` and `TFTP Server Name` to only return the expected values.

I've created a new file that contains these options:

```auto
dhcp-option=66,"10.10.3.2"
dhcp-boot=pxelinux.0,10.10.3.2

```

under /etc/dnsmasq.d and it loads correctly. I've verified that there are no additional characters at the end of the lines or file.

## Actual Behaviour:

However - what is being returned has an extra null character `\x00` being returned to the DHCP clients, which is causing PXE booting not to happen:

```auto
| broadcast-dhcp-discover: 
| Response 1 of 1: 
| IP Offered: 10.10.30.30
| DHCP Message Type: DHCPOFFER
| Server Identifier: 10.10.3.80
| IP Address Lease Time: 2m00s
| Bootfile Name: pxelinux.0\x00
| Renewal Time Value: 1m00s
| Rebinding Time Value: 1m45s
| Subnet Mask: 255.255.192.0
| Broadcast Address: 10.10.63.255
| Domain Name: tylephony.com
| TFTP Server Name: 10.10.3.2\x00
| Domain Name Server: 10.10.3.80, 10.10.3.81
|_ Router: 10.10.0.1

```

The Bootfile Name and TFTP Server name should not have the `\x00` at the end of the line.

I'm using the nmap command to test:

`nmap -n -sU -p67 --script broadcast-dhcp-discover`

## Debug Token:

[https://tricorder.pi-hole.net/23xr1kxlo6](https://tricorder.pi-hole.net/23xr1kxlo6)

Thanks!

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [May 21, 2020, 9:43am UTC](https://discourse.pi-hole.net/t/option-66-null-character-provided-by-dnsmasq/33015/2 "2020-05-21T09:43:52Z")

</div>

If this would be a bug (which I suggest it isn't), you would have to address this with [_`dnsmasq`_ development](http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/), as Pi-hole is embedding _`dnsmasq`_ as DHCP server.

[RFC 951 section 3](https://tools.ietf.org/html/rfc951#section-3) (_Packet Format_) requires the boot file name (as provided by option _ **`dhcp-boot`** _) to be a null terminated string.

[RFC 2132 section 9.4](https://tools.ietf.org/html/rfc2132#section-9.4) ff.(_TFTP server name_ and _Bootfile name_) define the respective parameters as a string of characters.  
[RFC 2132 section 2](https://tools.ietf.org/html/rfc2132#section-2) (BOOTP Extension/DHCP Option Field Format) allows usage of null terminated strings and further obligates clients to be able to deal with strings regardless if they are null terminated or not.

As far as RFCs are concerned, your observation doesn't constitue a bug.

It may indicate a failure of your client to conform to RFC 2132's requirement to corrrectly handle null terminated strings.  
But since these are proven and well-known protocols, I suspect a configuration error to be behind this.

As you seem to use a separate DHCP/BOOTP server at _`10.10.3.2`_ to enable PXE booting, you want to make sure that is reachable at boot time and that a proper _pxelinux.0_ file is indeed located in that machine's root directory.

---

<div class="post-metadata">

**Author:** ![Lux4rd0](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/lux4rd0/32/15446_2.png) [@Lux4rd0](https://discourse.pi-hole.net/u/Lux4rd0)\
**Post date:** [May 21, 2020, 8:51pm UTC](https://discourse.pi-hole.net/t/option-66-null-character-provided-by-dnsmasq/33015/3 "2020-05-21T20:51:39Z")

</div>

Appreciate the insights and thoroughness of your response. After spending hours trying to get validation that the new configs were being sent out via dnsmasq - my PXE boot still isn't happening successful. I'll continue with the premise that null characters for those two options should be handled appropriately by the clients and chase other configurations to resolve my issues.

> regardless if they are null terminated or not

Thanks again!!

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [June 13, 2020, 5:42pm UTC](https://discourse.pi-hole.net/t/option-66-null-character-provided-by-dnsmasq/33015/16 "2020-06-13T17:42:15Z")

</div>

Closed on June 13, 2020, 5:42pm UTC

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
