How to force firefox accessing Facebook/Twitter via IPv4

[Issue]

1. Facebook and Twitter are special treated in China.
2. I use IPv4/IPv6 tunnel to access Internet, so disabling IPv6 globally is not desirable.
3. I need to use school's DNS server, but that DNS return wrong answer of facebook/twitter.

[Resolution]

1. Configure Firefox to access Facebook/twitter via IPv4 only.
a. Type "about:config" in firefox address field, press Enter.
b. Click "I'll be careful, I promise!".
c. Set value of " network.dns.ipv4OnlyDomains " to " facebook.com, www.facebook.com, twitter.com "
d. Close the tab.

2. Configure /etc/hosts
a. Get valid IPv4 address of Facebook/Twitter. ( use nslookup with server 8.8.8.8 )

$ nslookup 
> server 8.8.8.8
Default server: 8.8.8.8
Address: 8.8.8.8#53
> facebook.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	facebook.com
Address: 173.252.120.6
> www.facebook.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
www.facebook.com	canonical name = star.c10r.facebook.com.
Name:	star.c10r.facebook.com
Address: 31.13.70.1
> twitter.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	twitter.com
Address: 199.59.150.7
Name:	twitter.com
Address: 199.59.150.39
Name:	twitter.com
Address: 199.59.149.198
Name:	twitter.com
Address: 199.59.149.230

b. Add entries to /etc/hosts

173.252.120.6 facebook.com
31.13.70.1 www.facebook.com
199.59.150.39 twitter.com