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


16205 questions
100
votes
7 answers

How can I do DNS lookups in Python, including referring to /etc/hosts?

dnspython will do my DNS lookups very nicely, but it entirely ignores the contents of /etc/hosts. Is there a python library call which will do the right thing? ie check first in etc/hosts, and only fall back to DNS lookups otherwise?
Toby White
  • 1,255
  • 2
  • 8
  • 8
98
votes
4 answers

How do I set up DNS for an apex domain (no www) pointing to a Heroku app?

I already added a custom domain to my Heroku app and it works with www.domain.com. I need to know how to set up the domain without www to resolve to the app, too. Here are my current DNS settings: $TTL 86400 @ IN SOA ns1.first-ns.de.…
mrks
  • 4,642
  • 7
  • 38
  • 56
97
votes
10 answers

Mac OSX Lion DNS lookup order

After upgrading to Mac OSX Lion I figured out that /etc/hosts is not looked up in first place for name resolution anymore. This leads to some side effects like: Entries in /etc/hosts are resolved painfully slow You can't not override existing…
Meik
  • 979
  • 1
  • 7
  • 3
95
votes
16 answers

Can I perform a DNS lookup (hostname to IP address) using client-side Javascript?

I would like to use client-side Javascript to perform a DNS lookup (hostname to IP address) as seen from the client's computer. Is that possible?
Noah Jacobson
  • 1,159
  • 1
  • 10
  • 13
92
votes
3 answers

Is it possible that one domain name has multiple corresponding IP addresses?

For example, when we connect to www.example.com, at first we try to connect to 192.0.2.1. And if first try fails, then we try 192.0.2.222. Is it possible? Can we register multiple backup IP addresses for one domain name?
firia2000
  • 1,493
  • 4
  • 18
  • 19
86
votes
9 answers

.htaccess rewrite subdomain to directory

Is it possible to use .htaccess to rewrite a sub domain to a directory? Example: http://sub.domain.com/ shows the content of http://domain.com/subdomains/sub/
Erik Djupvik
  • 1,157
  • 1
  • 10
  • 13
84
votes
3 answers

Assigning vhosts to Docker ports

I have a wildcard DNS set up so that all web requests to a custom domain (*.foo) map to the IP address of the Docker host. If I have multiple containers running Apache (or Nginx) instances, each container maps the Apache port (80) to some external…
ringmaster
  • 2,379
  • 1
  • 22
  • 27
83
votes
9 answers

Creating self signed certificate for domain and subdomains - NET::ERR_CERT_COMMON_NAME_INVALID

I followed this tutorial for creating Signed SSL certificates on Windows for development purposes, and it worked great for one of my domains(I'm using hosts file to simulate dns). Then I figured that I have a lot of subdomains, and that would be a…
Zed
  • 4,821
  • 6
  • 34
  • 71
81
votes
8 answers

Network calls fail during image build on corporate network

I'm having a problem building Docker images on my corporate network. I'm just getting started with Docker, so I have the following Dockerfile for a hello-world type app: # DOCKER-VERSION 0.3.4 FROM centos:6.4 # Enable EPEL for Node.js RUN …
dsw88
  • 4,102
  • 7
  • 35
  • 47
80
votes
6 answers

Amazon S3: Static Web Sites: Custom Domain or Subdomain

Amazon.com just announced that one can host static web sites in a S3 bucket. I went to their setup page at http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?WebsiteHosting.html and created a bucket for my static web site, and it…
Jay Godse
  • 14,293
  • 15
  • 80
  • 124
78
votes
5 answers

How do I get the local machine name in C#?

How do I get the local machine name?
Yoann. B
  • 10,667
  • 18
  • 65
  • 110
78
votes
9 answers

How can I set / change DNS using the command-prompt at windows 8

How can I set my DNS settings using the command-prompt or bat file at windows 8 I tried this: netsh interface ip set dns name="Local Area Connection" source=static addr=none but not worked.
Zuhair Taha
  • 1,811
  • 1
  • 26
  • 29
77
votes
1 answer

Is www a subdomain?

I recently purchased something.com. When I visit something.com from my browser, I get the index page I uploaded on server. However, if I visit www.something.com, it shows Error 404. So I create a sub-domain named 'www' and upload another index file…
aBhijit
  • 4,524
  • 8
  • 32
  • 53
77
votes
3 answers

Multiple GitHub Pages and custom domains via DNS

I want to have one user page and multiple project pages hosted by GitHub Pages but available under ONE custom domain (with subdomains for each GitHub Pages repository, of course). So my goals are as follows: One user page…
Florian Wolters
  • 3,273
  • 3
  • 25
  • 47
75
votes
10 answers

Why does Microsoft Edge open some local websites, but not others, where the domain name is routed to 127.0.0.1 in hosts file

Like a lot of programmers, I test sites locally. I use the hosts file to map domain names to my local ip (127.0.0.1). I use qualified domain names, usually with a "d" subdomain (for "development"). For example: d.somewebsite.com…
Evan de la Cruz
  • 1,912
  • 1
  • 12
  • 15