Tuesday, January 24, 2012

DNS TTL Cheat Sheet

When migrating a DNS from an old server to a new server I lower the TTL 24 hours before so that when I make the change external users get the new site within an hour instead of the old site because the DNS information is cached for 24 hours.

When lowering the TTL I end up having to ask someone or look it up enough that I'm posting this cheat sheet for myself to search in the future. So if a longer TTL is inherited from the top of the zone file and foo.tld inherits that time it would look like the following:

foo                        A       123.456.7.8
To lower it's TTL to one hour I simply insert the time with units (else it's seconds) in between the hostname and the A:
foo        1h              A       123.456.7.8
Then after reloading the zone file query that DNS server for the name:
dig @123.456.2.1 foo.bar.com
and make sure the ANSWER section contains 3600, which is the number of seconds in an hour:
;; ANSWER SECTION:
foo.tld. 3600    IN      A       123.456.7.8

Monday, January 16, 2012

svn2git

Nothingmuch's Migrating from Subversion to Git worked for me for two SVN repos that I'm actively working on.

Quick notes:

yum install git-svn
git svn clone --prefix=svn/ --stdlayout --authors-file=authors.txt 
git svn-abandon-fix-refs
git svn-abandon-cleanup
This makes a clean git repo complete with tags, branches, and history. Now set the "central" repo location :
git remote add origin 
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
finally, push it up to the server :
git push origin master