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
69
votes
3 answers

What are the trade-offs between different methods of constructing API URLs: subdomain vs. subdirectory and versioning?

We have a web application with a domain name of example.com. Now we want to extend a part of this application as a REST API, and we are debating on the best URL pattern. We could use the URL pattern api.example.com or example.com/api. What…
Abhijith Prabhakar
  • 1,325
  • 3
  • 12
  • 24
68
votes
8 answers

How to extract top-level domain name (TLD) from URL

how would you extract the domain name from a URL, excluding any subdomains? My initial simplistic attempt was: '.'.join(urlparse.urlparse(url).netloc.split('.')[-2:]) This works for http://www.foo.com, but not http://www.foo.com.au. Is there a way…
hoju
  • 28,392
  • 37
  • 134
  • 178
67
votes
6 answers

Firebase hosting not validating TXT record in GoDaddy

I deployed my app and now I'm trying to add my custom URL. I followed Firebase's instructions and added their TXT record to my DNS (GoDaddy). But now Firebase is saying it's still not verified. I assume I'm doing something wrong, but there's not…
DoubleTri
  • 861
  • 1
  • 7
  • 14
66
votes
1 answer

CNAME SSL certificates

If I go to www.example.com which has an image on the page that links to assets.example.com which is a CNAME for assets.example2.com. Will I get the green lock even if assets.example2.com does not have a certificate, but assets.example.com does?
maletor
  • 7,072
  • 7
  • 42
  • 63
66
votes
7 answers

CNAME entry not working on NameCheap using Amazon Certificate Manager

I am trying to set up a few SSL certificates in Amazon Certificate Manager, but I am trouble getting them verified after adding the CNAME in Namecheap. Here is an example of the CNAME verification entries at Amazon Certificate Manager Here is an…
sigur7
  • 796
  • 1
  • 11
  • 35
65
votes
3 answers

Hosting two domains using only one VPS?

Is it possible? Someone told me it is but I'm not sure. If its possible, how should I do it? I have one /www folder where my website lies. How can I configure 2 different sites?
Artemix
  • 8,497
  • 14
  • 48
  • 75
65
votes
2 answers

Python lookup hostname from IP with 1 second timeout

How can I look up a hostname given an IP address? Furthermore, how can I specify a timeout in case no such reverse DNS entry exists? Trying to keep things as fast as possible. Or is there a better way? Thank you!
ensnare
  • 40,069
  • 64
  • 158
  • 224
64
votes
14 answers

DNS problem, nslookup works, ping doesn't

I am setting up a development server in my flat. I have set up an Ubuntu DNS server on it and have added the zone weddinglist (just weddinglist - no TLD. It's just an internal domain.) This works fine on my Ubuntu laptop. On all my Windows PCs…
user42088
  • 641
  • 1
  • 5
  • 3
63
votes
4 answers

Can HTML5 databases and localStorage be shared across subdomains?

I am attempting to share data across subdomains using Safari. I would like to use an HTML5 database (specifically localStorage as my data is nothing but key-value pairs). However, it seems as though data stored to example.com can not be accessed…
Sebastian Celis
  • 12,185
  • 6
  • 36
  • 44
61
votes
5 answers

Cloud Functions for Firebase - getaddrinfo ENOTFOUND

Trying to make a request to Paypal's API using PayPal-node-SDK exports.requestPayment = functions.https.onRequest((req, res) => { return new Promise(function (fullfilled, rejected) { paypal.payment.create(create_payment_json, {},…
user47376
  • 2,263
  • 3
  • 21
  • 26
61
votes
5 answers

Cross Domain Login - How to log a user in automatically when transferred from one domain to another

We offer a number of online services. We are required to develop a system which provides a quick/simple experience for users if they are transferred from one service (on domain1.com) to another service (on domain2.com). Is there a safe and secure…
smashedmercury
  • 901
  • 2
  • 9
  • 8
60
votes
6 answers

How do I redirect a naked (apex) domain to www using Route 53?

I need to do a 301 redirect from example.com to www.example.com using Route 53 (and S3 if necessary). There are a few solutions for similar problems but they either do not address how to redirect from the apex or they simply don't work. When I…
Barrett Kuethen
  • 1,864
  • 7
  • 25
  • 33
60
votes
5 answers

How to force DNS refresh for a website?

I'm moving my web application to another server and in the next few days I'll refresh the DNS to point to the new IP location. Unfortunately some browsers and SOs keep a DNS cache that will make users point to the old IP location. Some users are…
Adriano Castro
  • 1,411
  • 4
  • 19
  • 33
58
votes
4 answers

How to assign domain names to containers in Docker?

I am reading a lot these days about how to setup and run a docker stack. But one of the things I am always missing out on is how to setup that particular containers respond to access through their domain name and not just their container name using…
Christopher Thomas
  • 4,424
  • 4
  • 34
  • 49
57
votes
12 answers

Virtual network interface in Mac OS X

I know that you can make a virtual network interface in Windows (see here), and in Linux it is also pretty easy with ip-aliases, but does something similar exist for Mac OS X? I've been looking for loopback adapters, virtual interfaces and couldn't…
Hans Doggen
  • 1,796
  • 2
  • 16
  • 13