This paper focuses on secure consensus for leader-following multiagent systems (MASs) modeled by partial differential equations (PDEs) under denial of service (DoS) attacks. To mitigate the negative effects of DoS attacks, which can paralyze communication and cause agents to fail to receive valid control inputs, a buffer region is established in the communication channels among agents to temporarily store messages from neighbors. Additionally, since the states of the leader and followers are not always measurable, observers are used to estimate these states. To address these challenges, this paper proposes two boundary controllers to ensure leader-following consensus in both measurable and unmeasurable states. One controller is based on original boundary information, while the other utilizes observation information from both the leader and followers. To the best of our knowledge, this is the first attempt to use buffers to solve a class of PDEs-based MASs under DoS attacks. Furthermore, the boundary control approach has the potential to significantly reduce the number of actuators required, thereby lowering control costs. Finally, we present two numerical examples to validate the feasibility of the proposed methods.