Fine tune model with dataset of questions and answers

Is there any way to make the answers only from dataset and otherwise answer “I don’t know”. I want to my model answer only about data set he learned