DNS and authoritative answers

Written on 13 November 2013, 05:37pm

Tagged with: , , ,

A simple trick about nslookup that I learned while reading the Smashing Magazine’s free preview of their Book #4

To start, the full syntax of nslookup is:
nslookup [-option] [hostname] [server]

When you run nslookup [hostname], it’s your local DNS server that answers the query. This answer is non-authoritative.
With an additional step, you can get the local name servers of the hostname: nslookup -type=ns [hostname]
Using one of these local DNS servers, you can query again: nslookup [hostname] [local_name_server]. This answer is authoritative.


$ nslookup www.smashingmagazine.com
Server: 194.168.4.100
Address: 194.168.4.100#53
Non-authoritative answer:
Name: www.smashingmagazine.com
Address: 80.72.139.101

$ nslookup -type=ns www.smashingmagazine.com
Server: 194.168.4.100
Address: 194.168.4.100#53
Authoritative answers can be found from:
smashingmagazine.com
origin = a.regfish-ns.net
mail addr = postmaster.regfish.com...

$ nslookup www.smashingmagazine.com a.regfish-ns.net
Server: a.regfish-ns.net
Address: 79.140.49.11#53
Name: www.smashingmagazine.com
Address: 80.72.139.101

To clean the DNS cache, use ipconfig /flushdns.

Paul Tero – How To Fix The Web: Obscure Back-End Techniques And Terminal Secrets
From the same author – Introduction to DNS: Explaining The Dreaded DNS Delay
smashing-book-4-cover

Update 12/feb/2017:

HTTP basic authentication

Written on 3 November 2013, 12:28pm

Tagged with: , ,

A few notes:

– it only uses HTTP headers
– it does not encrypt the username:password, it only base64 encodes them to obtain a string (think about a password containig two newlines 🙂 )
– so it is highly recommended to be used over HTTPS
– if this is not possible, then HTTP digest authentication should be used instead
– initially, the server responds with a HTTP 401 Non Authorized response code
– the HTTP headers must be sent by the browser with every subsequent request, so caching is necessary
– the web server does not provide a ‘log out’ mechanism; each browser has its own way of logging out. Example for Chrome: load http://username@mysite.com

More details on the Wikipedia page: http://en.wikipedia.org/wiki/Basic_access_authentication
HTTP Digest Access Authentication: http://en.wikipedia.org/wiki/Digest_access_authentication
How to set up HTTP Basic Authentication in Apache: http://wiki.apache.org/httpd/PasswordBasicAuth

iStock_000010892293Small
Photo: iStockPhoto