Closed nodesocket closed 7 years ago
Thats strange, here's mine:
#listen on container interface
listen-address=0.0.0.0
interface=eth0
user=root
#only use these namesservers
no-resolv
server=8.8.4.4
server=8.8.8.8
#================
#redirect .service requests into the cluster
server=/service/1.2.2.2
#================
#static entries
address=/foo.bar/1.2.3.4
address=/foo.bar/1.2.3.4
address=/foo.bar/1.2.3.4
address=/foo.bar/1.2.3.4
address=/foo.bar/1.2.3.4
address=/foo.bar/1.2.3.4
address=/foo.bar/1.2.3.4
Any difference saving via the web ui?
I updated the curl request to:
$ curl --silent --show-error --location --request POST --data-binary "@/tmp/files/dnsmasq.conf" http://127.0.0.1:8080/configure
And now that just returns, without any body. Is that right?
Also, by the way, I am calling the POST without any /etc/dnsmasq.conf
file already created.
ah data-binary
, that probably did it, yep should just return just a 200 OK
Very strange though, it appears to be working, yet the domain I am "spoofing" is still resolving to the real ip:
$ curl --silent --show-error --request POST --data-binary "@/tmp/files/dnsmasq.conf" http://127.0.0.1:8080/configure
$ ping -c 1 brand.com
PING brand.com (72.52.4.91): 56 data bytes
Is there any output, or way to view logs what is happening?
@jpillora sorry to bother, but still can't quite get this working. Any insight based on my above comment?
Here is the contents of /tmp/files/dnsmasq.conf
:
#listen on container interface
listen-address=0.0.0.0
interface=eth0
user=root
#only use these namesservers
no-resolv
server=8.8.4.4
server=8.8.8.8
#static entries
address=/.brand.com/127.0.0.1
Try dropping the leading .
in .brand.com
Isn't that required for wildcard? I guess, I wish when calling the RESTful endpoint:
POST /configure
It would output that the dnsmasq
service was restarted successfully or not... The output.
Ah yes, you're right, never used wildcard before. When it returns 200
, it means service dnsmasq restart
exited with 0
. Just tested it. It works fine.
$ host foo.brand.com 10.9.3.2
Using domain server:
Name: 10.9.3.2
Address: 10.9.3.2#53
Aliases:
foo.brand.com has address 127.0.0.1
Docker ports mapped?
I've migrated to alpine linux, so I think this is fixed, re-open if it's still an issue
Trying to create a dnsmasq config via curl, but it keeps on erroring with:
Here is the config file
/tmp/files/dnsmasq.conf
I am sending into curl:And the curl command: