Image for post
Image for post

Wildcard Subdomains with DNSMasq

Jongwon Han
Jul 12, 2016 · 3 min read

환경

OS      : Ubuntu 14.04.3
(http://cloud-images.ubuntu.com/vagrant/trusty/ 에서 20151021)
DNSMasq : 2.68

시작

Calling Format  | URL
------------------------------------------------------------------Subdomain | http(s)://[bucket].s3.amazonaws.com/[object]
Ordinary | http(s)://s3.amazonaws.com/[bucket]/[object]

문제

1 #
2 # /etc/hosts
3 #
4 127.0.0.1 aaaa.dummy_domain.com
5 127.0.0.1 bbbb.dummy_domain.com
6 127.0.0.1 cccc.dummy_domain.com
7 ...

해결

1 #!/usr/bin/env bash
2 set -e
3
4 apt-get -y install dnsmasq
5
6 cp /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
7 echo 'address=/.dummy_domain.com/127.0.0.1' >> /etc/dnsmasq.conf
8
9 service dnsmasq restart

마무리

Hard Boiled Smith Stories

QA Test 자동화 전문 기업 HBsmith의 Blog — https://hbsmith.io

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store