Skip to content

Instantly share code, notes, and snippets.

@swhitt
Created September 27, 2012 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swhitt/3796576 to your computer and use it in GitHub Desktop.
Save swhitt/3796576 to your computer and use it in GitHub Desktop.
swhitt@calculon:~$ dig williampaid.com
; <<>> DiG 9.8.3-P1 <<>> williampaid.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47864
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;williampaid.com. IN A
;; Query time: 4 msec
;; SERVER: 10.0.1.1#53(10.0.1.1)
;; WHEN: Thu Sep 27 16:27:39 2012
;; MSG SIZE rcvd: 33
swhitt@calculon:~$ dig www.williampaid.com
; <<>> DiG 9.8.3-P1 <<>> www.williampaid.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37320
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.williampaid.com. IN A
;; ANSWER SECTION:
www.williampaid.com. 3509 IN A 75.101.164.97
;; Query time: 6 msec
;; SERVER: 10.0.1.1#53(10.0.1.1)
;; WHEN: Thu Sep 27 16:27:50 2012
;; MSG SIZE rcvd: 53
@swhitt
Copy link
Author

swhitt commented Sep 27, 2012

For example, Yahoo does 301 redirect on yahoo.com to www.yahoo.com:

swhitt@calculon:~$ curl -v yahoo.com
* About to connect() to yahoo.com port 80 (#0)
*   Trying 98.139.183.24...
* connected
* Connected to yahoo.com (98.139.183.24) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
> Host: yahoo.com
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Date: Thu, 27 Sep 2012 21:31:55 GMT
< Location: http://www.yahoo.com/
< Vary: Accept-Encoding
< Content-Type: text/html; charset=utf-8
< Cache-Control: private
< Age: 0
< Transfer-Encoding: chunked
< Connection: keep-alive
< Server: YTS/1.20.13
< 
The document has moved <A HREF="http://www.yahoo.com/">here</A>.<P>
<!-- w44.fp.bf1.yahoo.com uncompressed/chunked Thu Sep 27 14:31:55 PDT 2012 -->
* Connection #0 to host yahoo.com left intact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment