Questions tagged [dns]

DNS QUESTIONS MUST BE PROGRAMMING RELATED. Use this tag for programming questions related to writing code that interacts with the Domain Name System (DNS); for example, writing code that uses gethostbyname()

Don’t use this tag for questions that aren’t about programming. StackOverflow as a site is only for questions about programming. If you have a DNS-related question about server configuration, DNS configuration, or other non-programming questions, consider instead posting on:

Background information on DNS

The Domain Name System (DNS) is a hierarchical naming system built on a distributed database. It translates domain names meaningful to humans into the IP addresses associated with the networking device. For example: www.stackoverflow.com => 64.34.119.12

One thing that DNS makes possible is changing the IP address while not changing the name. This allows moving the site to another provider, without requiring users to learn anything new. It is also possible to have several different DNS names resolve to the same IP address, and have the same http web server at that IP address handle the different names as different websites.

As already stated, DNS is hierarchical and distributed system. In looking up cs.luc.edu four different DNS servers may be required: for the so-called "DNS root zone", for edu, for luc.edu and cs.luc.edu. Searching hierarchy can be cumbersome, so DNS search results are usually cached locally.

Specification

The concepts of the Domain Name System are explained in RFC1034. The specification and implementation are described in RFC1035.

Reference

Domain Name System on Wikipedia

An Introduction to Computer Networks by Peter L Dordal


17147 questions
57
votes
4 answers

Set specific DNS server using dns.resolver (pythondns)

I am using dns.resolver from dnspython. Is it possible to set the IP address of the server to use for queries ?
Massimo
  • 3,171
  • 3
  • 28
  • 41
57
votes
2 answers

Wildcard subdomains with dnsmasq

I have a device that is already mapped to domain.tld. I now want to create a wildcard for all subdomains *.domain.tld so that they are mapped to the ip of domain.tld, too. How do I do this with dnsmasq?
danb
  • 573
  • 1
  • 4
  • 5
56
votes
10 answers

how to disable direct access to a web site by ip address

I have a website on a VPS. The issue I am having is that when I enter the IP of the server, it links to the website. Even when entering mail.domain.com, it does the same thing. How do I disable that, so a visitor would get a message or be directed…
Khaled A
  • 561
  • 1
  • 4
  • 4
56
votes
2 answers

How to point subdomain to a Heroku app, and root domain to another Heroku app?

I'm having trouble with routing a subdomain to a Wordpress blog hosted on Heroku, and the root domain to another Heroku app. If I have purchased a domain called cheese.com on NameCheap and I'd like to route a subdomain like blog.cheese.com how could…
sergserg
  • 21,716
  • 41
  • 129
  • 182
55
votes
3 answers

Domain IP address for www and non-www for Canonical URL

To handle Canonical URL is it best practice to do a 301 redirect or better to have the same IP Address for both www and non www domain? For example: Canonical URL/domain wanted is http://example.com Domain | A…
Wasabi Developer
  • 3,523
  • 6
  • 36
  • 60
55
votes
5 answers

Firefox invalidate dns cache

I was too quick about visiting a site I set up on a customer server, and Firefox now remembers, that the default site for (example) testsite.mycompanyname.com (non existing subdomain, same as *.mycompanyname.com) is www.mycompanyname.dk - or…
Steen
  • 2,749
  • 2
  • 20
  • 36
54
votes
2 answers

Why isn’t it possible to use a CNAME redirect with HTTPS

This Google Storage documentation page states that You can use a CNAME redirect only with HTTP, not with HTTPS. But I cannot see any reason for that. Can anyone explain me why?
qdii
  • 12,505
  • 10
  • 59
  • 116
54
votes
4 answers

Firebase Hosting: We couldn't verify your domain example.com. Please check your settings and try again

I tried to add my custom domain to firebase hosting. But firebase can not verify. Though I add txt record in my domain control panel. Here is the the
Rifat Monzur
  • 640
  • 1
  • 5
  • 11
54
votes
1 answer

Docker-compose container using host DNS server

I'm running several containers on my "Ubuntu 16.10 Server" in a "custom" bridge network with compose 2.9 (in a yml version 2.1). Most of my containers are internally using the same ports, so there is no way for me to use the "host" network…
Olivier
  • 1,982
  • 3
  • 23
  • 36
54
votes
1 answer

What is the maximum length of a DNS name

I saw several mentions that the maximum string length of a DNS name (domain name) is 253 characters. Wikipedia seems to be referring this old blog…
Nicolas Bouvrette
  • 4,295
  • 1
  • 39
  • 53
54
votes
8 answers

How to get mx records for a dns name with System.Net.DNS?

Is there any built in method in the .NET library that will return all of the MX records for a given domain? I see how you get CNAMES, but not MX records.
Segfault
  • 8,036
  • 3
  • 35
  • 54
54
votes
1 answer

How do I set up GitHub Pages to redirect DNS requests from a subdomain (e.g. www) to the top-level domain (TLD, Apex record)?

How do I configure a DNS service provider in such a way that requests to both www.example.com and example.com would show a website hosted on GitHub Pages? My browser's address bar should contain example.com when the website is opened. My DNS service…
Jay
  • 3,445
  • 2
  • 24
  • 29
54
votes
2 answers

What does the authority section mean in dig results?

Yesterday I changed my domain's name server from cloudflare to dnspod. And I used dig to test it. But the ANSWER SECTION is always the old name servers. ;; AUTHORITY SECTION: amazingjxq.com. 21336 IN NS …
amazingjxq
  • 4,487
  • 7
  • 33
  • 35
54
votes
8 answers

Get IPv4 addresses from Dns.GetHostEntry()

I've got some code here that works great on IPv4 machines, but on our build server (an IPv6) it fails. In a nutshell: IPHostEntry ipHostEntry = Dns.GetHostEntry(string.Empty); The documentation for GetHostEntry says that passing in string.Empty…
zombat
  • 92,731
  • 24
  • 156
  • 164
53
votes
1 answer

Can I have a route53 subdomain in a different Hosted Zone?

I have foo.com as a Hosted Zone with an A, NS, SOA, TXT and MX Record Sets. It works fine. Now I want a separate test.foo.com with an A entry but I want it in a separate Hosted Zone. Is it possible? If I put an A record in foo.com's Hosted Zone with…
ddreian
  • 1,766
  • 5
  • 21
  • 29