Skip to content

Commit

Permalink
Add host.containers.internal DNS name
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumerose committed Sep 16, 2021
1 parent c157dcd commit 1108ea4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
13 changes: 13 additions & 0 deletions cmd/gvproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ func main() {
"192.168.127.2": "5a:94:ef:e4:0c:ee",
},
DNS: []types.Zone{
{
Name: "containers.internal.",
Records: []types.Record{
{
Name: "gateway",
IP: net.ParseIP("192.168.127.1"),
},
{
Name: "host",
IP: net.ParseIP("192.168.127.254"),
},
},
},
{
Name: "apps-crc.testing.",
DefaultIP: net.ParseIP("192.168.127.2"),
Expand Down
10 changes: 8 additions & 2 deletions test/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@ var _ = Describe("dns", func() {
Expect(string(out)).To(ContainSubstring("Address: 209.132.183.105"))
})

It("should resolve gateway.crc.testing", func() {
out, err := sshExec("nslookup gateway.crc.testing")
It("should resolve gateway.containers.internal", func() {
out, err := sshExec("nslookup gateway.containers.internal")
Expect(err).ShouldNot(HaveOccurred())
Expect(string(out)).To(ContainSubstring("Address: 192.168.127.1"))
})

It("should resolve host.containers.internal", func() {
out, err := sshExec("nslookup host.containers.internal")
Expect(err).ShouldNot(HaveOccurred())
Expect(string(out)).To(ContainSubstring("Address: 192.168.127.254"))
})
})

0 comments on commit 1108ea4

Please sign in to comment.