With the advances in pervasive computing, Internet of things (IoT) has gained considerable attention from both research and industrial communities. While IoT devices are able to provide computational services to other devices via device‐to‐device (D2D) communications, they are not guaranteed to be honest and collaborative. In such a context, the trust model can help to detect malicious service providers. However, malicious nodes may perform trust‐distortion attacks to mislead the trust model. They may perform on‐off attacks to remain undetected or bad‐mouth about others to make it difficult to infer if a contradictory recommendation comes from the on‐off nature of the evaluated node or dishonesty of the recommender. To address these issues, we propose T‐D2D, a lightweight trust model capable to face simultaneous trust‐distortion attacks. T‐D2D evaluates a node's nature using both short‐term and long‐term evaluation intervals to detect different types of on‐off attacks. Moreover, it keeps track of marginal misbehaving over several successive intervals to recognize the nature of suspicious on‐off nodes with light misbehaving attitude. To face bad‐mouthing attackers, T‐D2D limits its dependence on recommendations to when the direct trust is not decisive. Moreover, it evaluates the honesty of a recommender based on the correctness of its recommendations over time. Simulation results prove that T‐D2D exhibits significantly better performance than other counterparts in terms of trust level, correctness of calculated trust, percentage of selected malicious providers, total wasted execution time, and energy consumption in presence of simultaneous trust‐distortion attacks.