A printer comprising: communication means able to execute a first communication mode in which wireless communication is performed with a terminal device via an external access point, and a second communication mode in which the printer serves as a parent station to directly, wirelessly communicate with a terminal device without using the external access point; wherein the communication means is capable of performing wireless communication using a 2.4-GHz band and wireless communication using a 5-GHz band, respectively, the 5-GHz band including a frequency band in which a DFS, Dynamic Frequency Selection, function is required; control means for controlling the communication means and for setting a usage frequency band of the communication means; and print control means for executing printing based on data transmitted from the terminal device and received by the communication means via a communication using the usage frequency band set by the control means, wherein, in the first communication mode, the control means sets, as the usage frequency band of the communication means, a frequency band from the 2.4-GHz band and the 5-GHz band including the frequency band in which the DFS function is required; wherein in the second communication mode, the control means sets, as the usage frequency band, a frequency band that does not include the frequency band in which the DFS function is required, wherein, in a case where a setting of the first communication mode and a setting of the second communication mode are enabled in the printer, if the communication means executes communication of the first communication mode using the 2.4-GHz band, the control means sets based on the usage frequency band of the first communication mode, as the usage frequency band of the second communication mode, a frequency band that is the same frequency band as the usage frequency band of the first communication mode, and wherein, in the case where the setting of the first communication mode and the setting of the second communication mode are enabled in the printer, if the communication means executes the communication of the first communication mode using the frequency band in which the DFS function is required, the communication of the second communication mode is not executed using the frequency band in which the DFS function is required. communication means able to execute a first communication mode in which wireless communication is performed with a terminal device via an external access point, and a second communication mode in which the printer serves as a parent station to directly, wirelessly communicate with a terminal device without using the external access point; wherein the communication means is capable of performing wireless communication using a 2.4-GHz band and wireless communication using a 5-GHz band, respectively, the 5-GHz band including a frequency band in which a DFS, Dynamic Frequency Selection, function is required; control means for controlling the communication means and for setting a usage frequency band of the communication means; and print control means for executing printing based on data transmitted from the terminal device and received by the communication means via a communication using the usage frequency band set by the control means, wherein, in the first communication mode, the control means sets, as the usage frequency band of the communication means, a frequency band from the 2.4-GHz band and the 5-GHz band including the frequency band in which the DFS function is required; wherein in the second communication mode, the control means sets, as the usage frequency band, a frequency band that does not include the frequency band in which the DFS function is required, wherein, in a case where a setting of the first communication mode and a setting of the second communication mode are enabled in the printer, if the communication means executes communication of the first communication mode using the 2.4-GHz band, the control means sets based on the usage frequency band of the first communication mode, as the usage frequency band of the second communication mode, a frequency band that is the same frequency band as the usage frequency band of the first communication mode, and wherein, in the case where the setting of the first communication mode and the setting of the second communication mode are enabled in the printer, if the communication means executes the communication of the first communication mode using the frequency band in which the DFS function is required, the communication of the second communication mode is not executed using the frequency band in which the DFS function is required.