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
466
votes
9 answers

Custom domain for GitHub project pages

I have a gh-pages branch in one of my http://github.com repos. The GitHub project pages works fine if I go to http://myuser.github.com/myrepo I want to setup a custom domain (myexample.com) that will serve up this project pages. I want both…
rynop
  • 41,200
  • 23
  • 87
  • 99
424
votes
9 answers

How do browser cookie domains work?

Due to weird domain/subdomain cookie issues that I'm getting, I'd like to know how browsers handle cookies. If they do it in different ways, it would also be nice to know the differences. In other words - when a browser receives a cookie, that…
Vilx-
  • 97,629
  • 82
  • 259
  • 398
384
votes
21 answers

Regular expression to match DNS hostname or IP Address?

Does anyone have a regular expression handy that will match any legal DNS hostname or IP address? It's easy to write one that works 95% of the time, but I'm hoping to get something that's well tested to exactly match the latest RFC specs for DNS…
DonGar
  • 6,462
  • 6
  • 26
  • 31
338
votes
18 answers

Get protocol, domain, and port from URL

I need to extract the full protocol, domain, and port from a given URL. For example: https://localhost:8181/ContactUs-1.0/contact?lang=it&report_type=consumer >>> https://localhost:8181
yelo3
  • 4,893
  • 5
  • 22
  • 23
333
votes
12 answers

How do I find the authoritative name-server for a domain name?

How can I find the origins of conflicting DNS records?
Binarytales
  • 8,278
  • 8
  • 29
  • 37
330
votes
7 answers

Is it possible to have SSL certificate for IP address, not domain name?

I want my site to use URLs like http://192.0.2.2/... and https://192.0.2.2/... for static content to avoid unnecessary cookies in request AND avoid additional DNS request. Is there any way to obtain SSL cert for this purpose?
Evgenyt
  • 8,665
  • 12
  • 36
  • 44
302
votes
20 answers

Wildcards in a Windows hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost. The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local, site2.local etc, and have them all resolve…
EvilPuppetMaster
  • 7,052
  • 9
  • 31
  • 30
250
votes
8 answers

How do I get a list of all subdomains of a domain?

I want to find out all the subdomains of a given domain. I found a hint which tells me to dig the authoritative Nameserver with the following option: dig @ns1.foo.bar some_domain.com axfr But this never works. Has anyone a better idea/approach
cgicgi
  • 2,619
  • 2
  • 16
  • 5
237
votes
15 answers

How to use Google App Engine with my own naked domain (not subdomain)?

After hours of reading about and experimenting with DNS records I can access my Google App Engine app via these URLs: myappid.appspot.com www.myappid.myowndomain.com What does not work: myowndomain.com www.myowndomain.com I want to be able to…
Mark
  • 5,281
  • 5
  • 19
  • 10
226
votes
11 answers

Can (domain name) subdomains have an underscore "_" in it?

Can subdomains (domain names) have underscore _ in them?
Daniel Kivatinos
  • 21,262
  • 23
  • 57
  • 81
217
votes
9 answers

How can I list ALL DNS records?

Is there any way I can list ALL DNS records for a domain? I know about such things as dig and nslookup but they only go so far. For example, if I've got a subdomain A record as test A somedomain.co.uk then unless I specifically ask for it, eg. dig…
Ken
  • 2,423
  • 4
  • 14
  • 19
201
votes
2 answers

Can I map a hostname *and* a port with /etc/hosts?

Can I map an IP address like 127.0.0.1 to a domain name and a port? For example, I would like to map 127.0.0.1 to api.example.com:8000
Carson
  • 14,915
  • 19
  • 60
  • 82
176
votes
13 answers

What's the source of Error: getaddrinfo EAI_AGAIN?

My server threw this today, which is a Node.js error I've never seen before: Error: getaddrinfo EAI_AGAIN my-store.myshopify.com:443 at Object.exports._errnoException (util.js:870:11) at errnoException (dns.js:32:15) at…
ThomasReggi
  • 42,912
  • 63
  • 199
  • 343
174
votes
6 answers

What is the difference between 127.0.0.1 and localhost

Assuming the following is defined in .../hosts: 127.0.0.1 localhost What, if any, are the actual differences between using 127.0.0.1 and localhost as the server name, especially when hitting processes running locally that are listening for…
Bohemian
  • 365,064
  • 84
  • 522
  • 658
156
votes
16 answers

ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known

I am trying to set up a VPN with a Raspberry Pi, and the first step is gaining the ability to ssh into the device from outside my local network. For whatever reason, this is proving to be impossible and I haven't the slightest clue why. When I try…
qaxf6auux
  • 2,014
  • 3
  • 15
  • 19
1
2 3
99 100