Why might you run your own DNS server?

One of the things that makes DNS difficult to understand is that it’sdecentralized. There are thousands (maybe hundreds of thousands? I don’t know!) of authoritative nameservers, and at least10 million resolvers.And they’re running lots of different software! All these different serversrunning software means that there’s a lot of inconsistency in how DNS works,which can cause all kinds of frustrating problems.

But instead of talking about the problems, I’m interested in figuring out –why is it a good thing that DNS is decentralized?

why is it good that DNS is decentralized?

One reason is scalability – the decentralized design of DNS makes iteasier to scale and more resilient to failures. I find it really amazing thatDNS is still scaling well even though it’s almost 40 years old. This is veryimportant but it’s not what this post is about.

Instead, I want to talk about how the fact that it’s decentralized means thatyou can have control of how your DNS works. You can add more servers to thegiant complicated mess of DNS servers! Servers that you control!

Yesterday I asked on Twitter why you mightwant to run your own DNS servers, and I got a lot of great answers that Iwanted to summarize here.

you can run 2 types of DNS servers

There are 2 main types of DNS servers you can run:

  1. if you own a domain, you can run an authoritative nameserver for that domain
  2. if you have a computer (or a company with lots of computers), you can run a resolver that’s resolves DNS for those computers

DNS isn’t a static database

I’ve seen the “phone book” metaphor for DNS a lot, where domain names are likenames and IP addresses are like phone numbers.

This is an okay mental model to start with. But the “phone book” mental modelmight make you think that if you make a DNS query for google.com, you’llalways get the same result. And that’s not true at all!

Which record you get in reply to a DNS query can depend on:

  • where you are in the world (maybe you’ll get an IP address of a server that’s physically closer to you!)
  • if you’re on a corporate network (where you might be able to resolve internal domain names)
  • whether the domain name is considered “bad” by your DNS resolver (it might be blocked!)
  • the previous DNS query (maybe the DNS resolver is doing DNS-based load balancing to give you a different IP address every time)
  • whether you’re using an airport wifi captive portal (airport wifi will resolve DNS records differently before you log in, it’ll send you a special IP to redirect you)
  • literally anything

A lot of the reasons you might want to control your own server are related tothe fact that DNS isn’t a static database – there are a lot of choices youmight want to make about how DNS queries are handled (either for your domain or for your organization).

reasons to run an authoritative nameserver

These reasons aren’t in any particular order.

For some of these you don’t necessarily have to run your own authoritativenameserver, you can just choose an authoritative nameserver service that hasthe features you want.

To be clear: there are lots of reasons not to run your own authoritativenameserver – I don’t run my own, and I’m not trying to convince you that youshould. It takes time to maintain, your service might not be as reliable, etc.

reason: security

this tweet phrased it well:

risk of an attacker gaining DNS change access through your vendor’s customersupport people, who only want to be helpful. Or getting locked out from yourDNS (perhaps because of the lack of that). In-house may be easier to audit andverify the contents.

reason: you like running bind/nsd

One reason several people mentioned was “I’m used to writing zone files andrunning bind or nsd, it’s easier for me to just do that”.

If you like the interface of bind/nsd but don’t want to operate your ownserver, a couple of people mentioned that you can also get the advantages ofbind by running a “hidden primary” server which stores the records, but serveall of the actual DNS queries from a “secondary” server. Here are some pagesI found about configuring secondary DNS from from NS1 and cloudflare and Dyn as an example.

I don’t really know what the best authoritative DNS server to run is. I thinkI’ve only used nsd at work.

reason: you can use new record types

Some newer DNS record types aren’t supported by all DNS services, but if yourun your own you can support any record types you want.

reason: user interface

You might not like the user interface (or API, or lack of API) of the DNSservice you’re using. This is pretty related to the “you like running BIND”reason – maybe you like the zone file interface!

reason: you can fix problems yourself

There are some obvious pros and cons to being able to fix problems yourselfwhen they arise (pro: you can fix the problem, con: you have to fix theproblem).

reason: do something weird and custom

You can write a DNS server that does anything you want, it doesn’t have to just return a static set of records.

A few examples:

reason: to save money

Authoritative nameservers seem to generally charge per million DNS queries. Asan example, at a quick glance it looks like Route 53 charges about $0.50 permillion queries and NS1 charges about $8 per million queries.

I don’t have the best sense for how many queries a large website’sauthoritative DNS server can expect to actually need to resolve (what kinds ofsites get 1 billion DNS queries to their authoritative DNS server? Probably alot, but I don’t have experience with that.). But a few people in the repliesmentioned cost as a reason.

reason: you can change your registrar

If you use a separate authoritative nameserver for your domain instead of yourregistrar’s nameserver, then when you move to a different registrar all you hvaeto do to get your DNS back up is to set your authoritative DNS server to theright value. You don’t need to migrate all your DNS records, which is a hugepain!

You don’t need to run your own nameserver to do this.

reason: geo DNS

You might want to return different IP addresses for your domain depending onwhere the client is, to give them a server that’s close to them.

This is a service lots of authoritative nameserver services offer, you don’tneed to write your own to do this.

reason: avoid denial of service attacks targeted at someone else

Many authoritative DNS servers are shared. This means that if someone attacksthe DNS server for google.com or something and you happen to be using thesame authoritative DNS server, you could be affected even though the attackwasn’t aimed at you. For example, this DDoS attack on Dyn in 2016.

reason: keep all of your configuration in one place

One person mentioned that they like to keep all of their configuration (DNSrecords, let’s encrypt, nginx, etc) in the same place on one server.

wild reason: use DNS as a VPN

Apparently iodine is an authoritative DNSserver that lets you tunnel your traffic over DNS, if you’re on a network thatonly allows you to contact the outside world as a VPN.

reasons to run a resolver

reason: privacy

If someone can see all your DNS lookups, they have a complete list of all thedomains you (or everyone from your organization) is visiting! You might preferto keep that private.

reason: block malicious sites

If you run your own resolver, you can refuse to resolve DNS queries (by justnot returning any results) for domains that you consider “bad”.

A few examples of resolvers that you can run yourself (or just use):

  • Pi-Hole blocks advertisers
  • Quad9 blocks domains that do malware/phishing/spyware. Cloudflare seems to have a similar service
  • I imagine there’s also corporate security software that blocks DNS queries for domains that host malware
  • DNS isn’t a static database. It’s very dynamic, and answers often depend inreal time on the IP address a query came from, current load on contentservers etc. That’s hard to do in real time unless you delegate serving thoserecords to the entity making those decisions.
  • DNS delegating control makes access control very simple. Everything under azone cut is controlled by the person who controls the delegated server, soresponsibility for a hostname is implicit in the DNS delegation.

reason: get dynamic proxying in nginx

Here’s a cool story from this tweet:

I wrote a DNS server into an app and then set it as nginx’s resolver so that I could get dynamic backend proxying without needing nginx to run lua. Nginx sends DNS query to app, app queries redis and responds accordingly. It worked pretty great for what I was doing.

reason: avoid malicious resolvers

Some ISPs run DNS resolvers that do bad things like nonexistent domains to anIP they control that shows you ads or a weird search page that they control.

Using either a resolver you control or a different resolver that you trustcan help you avoid that.

reason: resolve internal domains

You might have an internal network with domains (likeblah.corp.yourcompany.com) that aren’t on the public internet. Running yourown resolver for machines in the internal network makes it possible to accessthose domains.

You can do the same thing on a home network, either to access local-onlyservices or to just get local addresses for services that are on the publicinternet.

reason: avoid your DNS queries being MITM’d

One person said:

I run a resolver on my LAN router that uses DNS over HTTPS for its upstream, soIoT and other devices that don’t support DoH or DoT don’t spray plaintext DNSoutside

that’s all for now

It feels important to me to explore the “why” of DNS, because it’s such acomplicated messy system and I think most people find it hard to get motivatedto learn about complex topics if they don’t understand why all this complexityis useful.

Thanks to Marie and Kamal for discussing this post, and to everyone on Twitterwho provided reasons

Note: This article have been indexed to our site. We do not claim legitimacy, ownership or copyright of any of the content above. To see the article at original source Click Here

Related Posts
Samsung ส่งนวัตกรรมสมาร์ทโฟน เพื่อเสริมพลังให้นักกีฬาและแฟนทั่วโลก ผ่านแคมเปญ ‘United by Passion’ ในการแข่งขันโอลิมปิกและพาราลิมปิกฤดูหนาว ปักกิ่ง 2022 thumbnail

Samsung ส่งนวัตกรรมสมาร์ทโฟน เพื่อเสริมพลังให้นักกีฬาและแฟนทั่วโลก ผ่านแคมเปญ ‘United by Passion’ ในการแข่งขันโอลิมปิกและพาราลิมปิกฤดูหนาว ปักกิ่ง 2022

ซัมซุง อิเลคโทรนิคส์ ในฐานะพันธมิตรระดับโลกของการแข่งขันกีฬาโอลิมปิกและพาราลิมปิก ร่วมมือกับคณะกรรมการโอลิมปิกสากลและคณะกรรมการพาราลิมปิกสากล นำเสนอนวัตกรรมสมาร์ทโฟนล่าสุดในการแข่งขันโอลิมปิกฤดูหนาว ปักกิ่ง 2022 เพื่อเป็นส่วนหนึ่งในการช่วยให้เหล่านักกีฬาและแฟนกีฬาทั่วโลกได้สัมผัสถึงจิตวิญญาณของการแข่งขันและได้ใกล้ชิดเป็นหนึ่งเดียวกัน ผ่านแคมเปญสุดสร้างสรรค์รูปแบบใหม่ ที่ใช้เทคโนโลยีอันล้ำสมัยเพื่อยกระดับประสบการณ์โอลิมปิกขึ้นไปอีกขั้น นางสเตฟานี ชอย รองประธานบริหารและหัวหน้าทีมการตลาดระดับโลก ธุรกิจโมบายล์ เอ็กซ์พีเรียนซ์ ซัมซุง อิเลคโทรนิคส์ กล่าวว่า “ซัมซุงถือเป็นพันธมิตรอันยาวนานของการแข่งขันกีฬาโอลิมปิกและพาราลิมปิก ที่อยู่เคียงข้างนักกีฬามากว่า 30 ปี ซึ่งเราทำหน้าที่สนับสนุนความฝันของพวกเขา พร้อมช่วยเชื่อมโยงนักกีฬากับแฟนๆ และครอบครัวผ่านเทคโนโลยีและนวัตกรรม” ครั้งนี้ ซัมซุงได้เปิดตัวศูนย์กิจกรรมทางการตลาดในรูปแบบดิจิทัลสำหรับการแข่งขันโอลิมปิกฤดูหนาว ปักกิ่ง 2022 ซึ่งประกอบไปด้วย การเปิดตัวนักกีฬาใน Team Samsung Galaxy, Virtual Media Center สำหรับสื่อมวลชน, การจัดแสดงผลิตภัณฑ์ซัมซุงใน Galaxy House บนแพลตฟอร์มตัวละครเสมือนจริงของ Zepeto รวมถึงแคมเปญ #CheerTogether พร้อมอีกหนึ่งไฮไลต์กับการเปิดตัว Galaxy Z Flip3 5G Olympic Edition สมาร์ทโฟนรุ่นพิเศษซึ่งมอบให้แก่นักกีฬาที่เข้าร่วมการแข่งขันโอลิมปิกและพาราลิมปิกในครั้งนี้ เปิดตัวนวัตกรรมสมาร์ทโฟนรุ่นพิเศษ Galaxy Z Flip3 5G Olympic Edition ในฐานะผู้ให้บริการอุปกรณ์สื่อสารแบบไร้สายแต่เพียงผู้เดียวสำหรับการแข่งขันกีฬาโอลิมปิกและพาราลิมปิก ซัมซุงจึงได้จัดเตรียมสมาร์ทโฟนรุ่นพิเศษ Galaxy Z Flip3 5G Olympic Edition ในดีไซน์ตัวเครื่องสีขาวเรียบหรู กรอบโลหะสีทอง พร้อมโลโก้ของซัมซุงและคณะกรรมการโอลิมปิกหรือพาราลิมปิกสากลที่ด้านหลัง ให้กับนักกีฬาทุกคนที่เข้าร่วมการแข่งขัน  โดยสมาร์ทโฟนรุ่นนี้ มาพร้อมกับฟีเจอร์การถ่ายภาพสำหรับการบันทึกและส่งต่อโมเมนต์อันน่าจดจำ และ Samsung Knox แพลตฟอร์มความปลอดภัยชั้นนำของอุตสาหกรรม เพื่อประสบการณ์การใช้งานที่ปลอดภัย รวมความหลงใหลให้เป็นหนึ่งเดียวกับ Team…
Read More
Chemical clues in 'Tasmanian devil' whiskers reveal their feeding habits, study says thumbnail

Chemical clues in 'Tasmanian devil' whiskers reveal their feeding habits, study says

根据一项新研究,有袋动物胡须中的化学线索可以揭示出它们几个月前--甚至几个季度前吃了什么。新南威尔士大学悉尼分校领导的研究发现,科学家通过研究袋獾(“塔斯马尼亚恶魔”)的胡须,至少可以窥探其九个月前的情况。 这些有袋动物身上长长的胡须上有它们过去吃过的食物的化学印记--这些记录可以帮助讲述关于它们的觅食习惯、栖息地使用以及它们如何应对环境变化的更广泛的故事。研究人员现在首次绘制了这一时间尺度,表明“塔斯马尼亚恶魔”的胡须可以捕捉到至少9个月的季节性饮食变化,有可能长达一年。最近发表在《生态圈》上的研究结果提供了一种监测濒危本地物种的方法,对其栖息地的干扰最小。该研究的高级作者、新南威尔士大学科学系教授Tracey Rogers说:“我们正在利用塔斯马尼亚恶魔的胡须来追溯时间。”“一旦被解剖,这些胡须可以像树木的年轮一样,描绘出动物在一年前吃了什么以及它们如何生活的画面。”到目前为止,用袋獾的胡须来追踪它的觅食习惯有点像使用一台无序的时间机器:科学家可以看到化学记录,但无法确认它们是来自一周、一个月还是一年前。为了更清楚地了解时间线,新南威尔士大学领导的研究小组以三个月的时间间隔向六只圈养的袋獾喂食富含重度稳定同位素的药片--这些原子类型不会随时间衰减为其他元素。这些稳定同位素起到了时间戳的作用,随着每个季节的过去而标记胡须。当一年多过去后,研究小组从每只动物身上取出最长的胡须进行分析。他们发现,胡须起初生长得很快,然后才放慢速度,而且它们口中不同部位的胡须长到了不同的最大长度。平均而言,最长的胡须至少保存了动物九个月的生态历史--但随着胡须的生长随着时间的推移而放缓,研究人员认为它们很可能可以保存一年。研究小组利用他们的发现创建了一个新的胡须分析模型,该模型可以帮助追踪这些最近被带到灭绝边缘的濒危动物在野外的情况。“塔斯马尼亚恶魔的数量目前正在恢复中,此前它受到了一种名为‘恶魔面部肿瘤病’(DFTD)的高度传播性癌症的破坏性影响,”该研究的主要作者Marie Attard博士说,她是伦敦大学皇家霍洛威学院的一名博士后研究助理,在新南威尔士大学攻读博士学位期间完成了这项工作。“自从20世纪90年代发现这种疾病以来,许多健康的个体已被转移到无病地区,或成为圈养繁殖计划的一部分,以帮助提高它们的数量。”“这种胡须分析工具将极大地提高它们在原有的和被转移的野生种群中的管理水平。”Rogers教授说:“硬组织的好处是,它们不能再改变了--它们基本上是死细胞。”该方法的一个主要好处是,它在对动物栖息地干扰最小的情况下采集到这些信息:每年摘取一次可能比为期一周的观察之旅更能深入了解“塔斯马尼亚恶魔”的生活方式。虽然科学家们可以开始在他们的研究中应用这个新模型,但Attard博士说,这个方法可以通过进一步的研究来改进,增加样本量,更准确地测量胡须的生长周期。使用该方法的研究人员也应该一次只拔一根胡须,因为胡须对于“塔斯马尼亚恶魔”如何体验它们的周围环境非常重要。DFTD是目前破坏“塔斯马尼亚恶魔”种群的疾病,其行为与人类已知的任何类型的癌症都不一样。事实上,这种类型的癌症--也就是具有传染性的癌症--在自然界中根本就很少见。Rogers教授说:“在哺乳动物中只有三种可传染的癌症实例。可悲的是,DFTD就是其中之一。”这种疾病在“塔斯马尼亚恶魔”种群中迅速传播,在动物之间传递,因为它们在战斗时互相撕咬。自1996年发现以来,它已经摧毁了许多袋獾种群。研究人员已经设计了不同的保护计划,以帮助最大限度地减少感染的传播和保护该物种,例如通过将个体重新安置到无病区或创建圈养繁殖计划来帮助提高其数量。Attard博士说,这些发现可以帮助这些保护工作,无论是通过识别野生种群中个体饮食和栖息地偏好的变化,还是帮助保护主义者选择合适的袋獾进行转移。她说:“作为塔斯马尼亚的顶级捕食者,袋獾在维持生态系统健康方面发挥着重要作用。”“我们可以从研究它们的胡须中获得的信息可以帮助保护者保护当前的袋獾种群,并将它们成功地重新引入到野外的区域。”“这些硬组织已经锁定了稳定的同位素,所以只要我们的一个头发样本就可以告诉我们在它生长时吃了什么。”在哺乳动物中只有三种类型的传染性癌症--而DFTD就是其中之一。在人类中,毛囊分析可用于医学研究以及长期药物测试。但在动物身上,这种测试方法有助于我们更多地了解动物的觅食习惯、季节性饮食转变以及它们如何应对环境变化。
Read More
Google details its security response to the war in Ukraine [Update: YouTube demonetizations] thumbnail

Google details its security response to the war in Ukraine [Update: YouTube demonetizations]

With the war in Ukraine ongoing, Google today detailed its company-wide response to the conflict with a focus on the “safety and security of our employees, users, and customers.” Update 2/26: Citing sanctions, YouTube this morning “paus[ed] a number of channels’ ability to monetize” videos with ads, while also “significantly limiting recommendations to these channels.”…
Read More
Index Of News
Total
0
Share