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
169
votes
7 answers

RRSet of type CNAME with DNS name foo.com. is not permitted at apex in zone bar.com

I own foo.com and bar.com. I am managing both in Route53. foo.com hosts my site, and I'd like to direct traffic from bar.com to foo.com. I tried to set up a CNAME record for bar.com pointing to foo.com, but I got the error message: RRSet of type…
fredley
  • 32,953
  • 42
  • 145
  • 236
161
votes
15 answers

Using DNS to redirect to another URL with a path

I'm trying to redirect a domain to another via DNS. I know that using IN CNAME it's posible. www.proof.com IN CNAME www.proof-two.com. What i need is a redirection with a path. When someone types www.proof.com, it should take them to to…
contacto contact
  • 1,635
  • 2
  • 11
  • 3
161
votes
5 answers

Set up DNS based URL forwarding in Amazon Route53

I'm trying to setup forwarding in Amazon Route53. My last DNS service (Nettica) allowed me to route requests to "aws.example.com" to "https://myaccount.signin.aws.amazon.com/console/". Is this functionality supported by Route53? How does Nettica…
Saurav
  • 3,096
  • 3
  • 19
  • 12
146
votes
11 answers

jquery, domain, get URL

How can I get the domain name with jquery ??
AlexC
  • 9,657
  • 17
  • 64
  • 98
143
votes
1 answer

Nginx Different Domains on Same IP

I would like to host 2 different domains in the same server using Nginx. I redirected both domains to this host via @ property. Although I configure 2 different server blocks, whenever I try to access second domain, it redirects to first one. Here…
berkayk
  • 2,376
  • 3
  • 21
  • 26
127
votes
10 answers

How to overcome root domain CNAME restrictions?

We are hosting many web applications for our customers. As is obvious they want to use their own domains to refer to those applications, usually they want that any user that either type http://www.customer1.example or http://customer1.example goes…
Geo
  • 8,663
  • 13
  • 63
  • 93
126
votes
9 answers

Create subdomains on the fly with .htaccess (PHP)

I am looking to create a system which on signup will create a subdomain on my website for the users account area. e.g. johndoe.website.example I think it would be something to do with the .htaccess file and possibly redirecting to another location…
Ben McRae
  • 3,551
  • 13
  • 36
  • 31
122
votes
4 answers

Static hosting on Amazon S3 - DNS Configuration

I'm working on a little webapp (all client-side) I want to host it on Amazon S3. I've found several guides on this and have managed to create myself a bucket (with the same name as my domain), set it as a website and upload some content. Where I'm…
Merlin Mason
  • 1,607
  • 2
  • 12
  • 14
121
votes
7 answers

How to make Java honor the DNS Caching Timeout?

We use GSLB for geo-distribution and load-balancing. Each service is assigned a fixed domain name. Through some DNS magic, the domain name is resolved into an IP that's closest to the server with least load. For the load-balancing to work, the…
ZZ Coder
  • 74,484
  • 29
  • 137
  • 169
117
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,425
  • 2
  • 9
  • 8
115
votes
4 answers

How to link godaddy domain with AWS Elastic Beanstalk environment?

I'm running into this problem trying to link my Godaddy domain with an AWS Elastic Beanstalk instance. I found a lot of documentation on how to link an EC2 instance with a domain on Godaddy but not for Elastic Beanstalk instance. So I ended up with…
Bob Bill
  • 1,159
  • 2
  • 8
  • 3
113
votes
18 answers

Get the subdomain from a URL

Getting the subdomain from a URL sounds easy at first. http://www.domain.example Scan for the first period then return whatever came after the "http://" ... Then you remember http://super.duper.domain.example Oh. So then you think, okay, find the…
jb.
  • 9,987
  • 12
  • 39
  • 38
112
votes
8 answers

Does hosts file exist on the iPhone? How to change it?

I am developing an application that query to the server. In my Mac, I use the hosts file to change the dns to point to a local server within my local area network. Now I need to test it with my iPhone, the problem is that my iPhone does not…
Hoang Pham
  • 6,899
  • 11
  • 57
  • 70
112
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,773
  • 5
  • 19
  • 20
111
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,319
  • 2
  • 11
  • 13