Corefile to return fix address

161 Views Asked by At

I want to always return a certain address for a domain with CoreDNS. My expectation would be to have some such section on Corefile:

domain.of.mine {
  address 192.168.122.122 #this of course doesn't work
} 

So, I'd always answer with that address for name in the domain. My question is: What's the easiest way to achieve this with CoreDNS?

I've looked through the available plugins and the one that sounded the closes to what I want was the template plugin, but I have a feeling there should be an easier way to this.

1

There are 1 best solutions below

0
On

What I came up with was using the template plugin:

domain.of.mine {
  template ANY ANY {
    answer "{{ .Name }} 60 {{ .Class }} {{ .Type }} 192.168.122.122"
  }
} 

It will effectively respond to any request with the specified address.