Between Subversion & Submission: Sources on Dina Demalkhuta Dina
Talmudic Sources

(ד) נודרין להרגין, ולחרמין, ולמוכסין, שהיא תרומה, אף על פי שאינה תרומה; שהן שלבית המלך, אף על פי שאינן שלבית המלך.

(4) One may vow [in front of] murderers and thieves and [royal] tax collectors that [something] is terumah [and therefore subject to separate, religiously-based regulations on consumption], even if it isn't terumah; [or] that they are property of the king, even if they aren't property of the king.

גמ'. והאמר שמואל: דינא דמלכותא דינא! אמר רב חיננא א"ר כהנא אמר שמואל: במוכס שאין לו קצבה. דבי ר' ינאי אמר: במוכס העומד מאליו.

But did Shmuel not teach: "The law of the kingdom is the law"?

Rav Hinana [from other sources, it appears to actually be Hanina] said: "This is the case of a tax collector with no legal limitation."

It was taught at the school of R' Yannai: "This is in the case of an unauthorized tax collector."

אין פורטין לא מתבת המוכסין, ולא מכיס של גבאין, ואין נוטלין מהם צדקה. אבל נוטל הוא מתוך ביתו או מן השוק.

One may not make change from the chest of an excise collector or from the wallet of a tax collector, or accept any charity [taken] from those places. But he may accept [charity] from them at their own house or in the market.

[ad loc] The Talmud['s Savoraitic voice] inquires of this Mishnah: if as Shmuel says, the law of the land is the law, then why would that be considered money which you could not take? The responses given are the same as those in Nedarim, and therefore the money is stolen money and cannot be benefited from.
[but in case you want it, the fuller text is below]

תנא אבל נותן לו דינר ונותן לו את השאר: ומוכסין והאמר שמואל דינא דמלכותא דינא אמר רב חנינא בר כהנא אמר שמואל במוכס שאין לו קצבה דבי ר' ינאי אמרי במוכס העומד מאליו

The Talmud Asks: But doesn’t Shmuel say that the law of the kingdom is the law, i.e., halakha requires Jews to obey the laws of the state in which they live. Accordingly, the customs are collected legally and it should be permitted to make use of the funds. The Talmud answers: Rabbi Ḥanina bar Kahana said that Shmuel says: The mishna is discussing a customs collector who does not have a limitation placed by the governor on the amount he may collect, and he collects as he pleases. Alternatively, the Sages of the school of Rabbi Yannai said: The mishna is discussing a customs collector who stands on his own, i.e., he was not appointed by the government but, on his own, he forces people to give him money.

Looking at the previous cases, what might be salient differences or similarities between falsely vowing to murderers and tax collectors on the one hand, and taking change from (or refusing to take change from) a tax collector?

אמר רב יהודה אמר שמואל: נכסי עובד כוכבים הרי הן כמדבר, כל המחזיק בהן זכה בהן; מ"ט? עובד כוכבים מכי מטו זוזי לידיה אסתלק ליה, ישראל לא קני עד דמטי שטרא לידיה, הלכך הרי הן כמדבר, וכל המחזיק בהן זכה בהן. א"ל אביי לרב יוסף: מי אמר שמואל הכי? והאמר שמואל: דינא דמלכותא דינא, ומלכא אמר: לא ליקני ארעא אלא באיגרתא!

R' Yehuda said in the name of Shmuel: "The property of a gentile is like that of the desert--one who make an act of acquisition acquires." What's the basis? Once the gentile receives his money, he no longer has ownership over it, but the Israelite does not acquire until he receives the deed--in that respect it is like the desert and one who takes hold of it acquires it.

Abaye said to R' Yosef: "Could Shmuel have said that? After all, Shmuel stated: 'The law of the land is the law.' And the law of the land is that land is acquired through a deed."

Some Medieval Sources

שו"ת הרמב"ן סימן מו

אמרינן דינא דמלכותא דינא…הדינין הידועין למלך בכל מלכותו. שהוא וכל המלכים אשר היו לפניו הנהיגו הדברים והם כתובים בדברי הימים ובחוקי המלכים. אבל מה שהמלך עושה לפי שעה או חק חדש שהוא עושה לקנוס פעם במה שלא נהגו בימי האבות חמסנותא דמלכא הוא ואין אנו דנין באותו הדין … ודיקנא לה מדאמרי' דינא דמלכותא דינא ולא אמרי' דינא דמלכא דינא.

Responsa of the Ramban, Chapter 46

[1194-1270, Catalonia]

It is said "the law of the land is the law"… [referring to] laws that are known throughout the kingdom. That he, and his predecessors enforced these matters, and it is written in the public records and laws of the kings. But what the king has done in the past hour, or a new law that he's enacted that was not in place before, it is the foulness of the king, and we do not adjudicate by that law…

And it is worth noting that we say "The law of the land is the law" (dina d'malkhuta dina) and not "The law of the king is the law" (dina d'malka dina).

חידושי הרשב"א מסכת נדרים כח:

ופירשו בתוס' בשם ה"ר אליעזר דדוקא במלכי אומות העולם אמרו דינא דמלכותא דינא ומשום דמצי אמר להו אם לא תעשו מצותי אגרש אתכם שהארץ שלו היא אבל במלכי ישראל לאו דינא דאינו יכול ליטול מהם משלהם כלום לפי שא"י כל ישראל שותפין בה ואין בה למלך יותר מלאיש אחר

Commentary of the Rashba [R' Shelomo ben Aderet, 1235 – 1310, Catalonia] on Nedarim [at source

And the Tosafot cite in the name of R' Eli'ezer that dina d'malkhuta dina was specifically stated in the case of gentile rulers, on the basis that the ruler can say "if you don't follow my statutes I can expel you from my land" since it is his land. However, kings of Israel cannot dispossess them of their land--since the Land of Israel is jointly held by all Jews, and the king doesn't own it any more than anyone else.

The Rashba and Ramban seem to offer two different justifications for the principle of dina demalkhuta dina—what might be the different implications and limiting principles? How might they extend from a medieval context to a modern context?
A Contemporary Source
A Case Study in Contemporary Halakhic Rhetoric—Rav Asher Weiss on Dina DeMalkhuta
By Prof. Chaim Saiman (June 23, 2010) [http://hirhurim.blogspot.com/2010/06/case-study-in-contemporary-halakhic.html]
RA [R' Asher Weiss] claims that the true basis of DMD [dina demalkhuta dina] is the fact that the Torah implies and the reality of political life demands assuming a foundational concept of political authority for both Jews and Gentiles. Citing Mishna Avot 3:2 אלמלא מוראה איש את רעהו חיים בלעו ["pray for the wellbeing of the regime, for without rules, man would swallow his neighbor alive"], RA suggests a social-contractarian grounding of politics. Moreover, RA argues that this is what Chazal [traditional rabbinic sources] mean by DMD—simply the power of the government to rule. As for what the rishonim were talking about—and why they failed to mention this point ולא נחלקו הראשונים אלא במהות הדין שרשו וטעמו האם סמכות המלך משום קבלת העם היא או שמא אין זה משום הסכמת העם כלל אלא משום שהארץ שלו, ואכמ"ל , which to the best of my understanding means: “The rishonim [medieval scholars] argued only as to the essence of the rule [of DMD] and its source and reasoning: whether the king’s authority is predicated on the consent of the governed or on account of the king’s ownership of the land. But here is not the place to delve into this matter further.” I suspect however, that this statement was never intended to convey much substantive content. Its goal is to assure the reader that due respect has been paid to the rishonim [medieval scholars]— and then proceed to the next point.
* * *
[E]ach rishon’s view presents a significant limitation as to the domain of secular authority. By offering a reworked theory of DMD however, RA legitimates nearly every method of governance employed by the modern administrative state.
Rabbi Asher Weiss — Weekly Shiur [lecture] of June 17, 2021
According to international law, no country belongs to any king. Even dictators, they all argue "we represent the people." . . . So according to the Rashba, the entire concept would be irrelevant today.
* * *
In my interpretation, dina demlakhusa dina is the essence of malkhus [sovereignty/kingship]. The question is only, what is considered legitimate malkhus? And therefore we need the general consent of the people [to be governed, as opposed to consent to specific laws]: it is not that you agree to this law [in particular] or that law—that's not binding. . . My interpretation is not that you agree to the laws; dina demalkhusa dina is just the defining fact of what is legitimate malkhus. Malkhus must be based on the consent of the people. Once you have the general consent of the people, you have the authority—full authority, whether they agree or not—because that is the essence of malkhus.